Subject: [alpine-user] How to check current and previously logged in users in Alpine 3.8.2?

From: Martin Gignac <[email-masked]>
Date: Thu, 10 Jan 2019 09:44:19 -0500

What is the proper way to check current and previously logged in users in
Alpine 3.8.2?

The "who" command does not appear to have been compiled in Alpine's Busybox
(although it _can_ be according to the man page). Installing coreutils does
give me the "who" command, but it returns nothing, even though I am logged
in on the console when executing it.

Also, executing the "last" command gives this error:

  couldn't open file '/dev/null/wtmp': Not a directory

Regards,
-Martin

---

From: PICCORO McKAY Lenz <[email-masked]>
Date: Thu, 10 Jan 2019 10:49:51 -0400

https://bugs.alpinelinux.org/issues/3282

El jue., 10 de ene. de 2019 a la(s) 10:45, Martin Gignac (
[email-masked]) escribió:

> The "who" command does not appear to have been compiled in Alpine's
> Busybox (although it _can_ be according to the man page). Installing
> coreutils does give me the "who" command, but it returns nothing, even
> though I am logged in on the console when executing it.
>

---

From: Martin Gignac <[email-masked]>
Date: Thu, 10 Jan 2019 10:17:57 -0500

Thanks for that. I'm a new Alpine Linux user and it completely escaped me
to check if it was a bug.

I'll do better next time.
-Martin

---

From: PICCORO McKAY Lenz <[email-masked]>
Date: Thu, 10 Jan 2019 11:20:00 -0400

umm, but some one in the list have a workaround? its a big fault!

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

El jue., 10 de ene. de 2019 a la(s) 11:18, Martin Gignac (
[email-masked]) escribió:

>>> What is the proper way to check current and previously logged in users
>>> in Alpine 3.8.2?
>>>

---

From: Vincent Bentley <[email-masked]>
Date: Thu, 10 Jan 2019 17:06:09 +0000

I think Joey Smith's suggestion for using utmps is worth investigating.

https://skarnet.org/software/utmps/index.html
https://skarnet.org/software/utmps/overview.html

The examples in the git repo show that it can be used with OpenRC 
although it still needs the s6-ipcserver.

For utmpd...

#!/sbin/openrc-run

name="utmpd"
command="s6-ipcserver"
command_args="/run/utmps/utmpd-socket utmps-utmpd"
command_background=yes
command_user=utmp
pidfile="/run/utmps/utmpd.pid"
start_stop_daemon_args="-d /run/utmps"

start_pre() {
    checkpath -D -d -o utmp:utmp -m 0755 /run/utmps
}

For wtmpd...

#!/sbin/openrc-run

name="wtmpd"
command="s6-ipcserver"
command_args="/run/utmps/wtmpd-socket utmps-wtmpd"
command_background=yes
command_user=utmp
pidfile="/run/utmps/wtmpd.pid"
start_stop_daemon_args="-d /run/utmps"

start_pre() {
    checkpath -D -d -o utmp:utmp -m 0755 /run/utmps
}

On 10/01/2019 14:49, PICCORO McKAY Lenz wrote:
> El jue., 10 de ene. de 2019 a la(s) 10:45, Martin Gignac 
> ([email-masked] <mailto:[email-masked]>) escribió:
> 
>     What is the proper way to check current and previously logged in
>     users in Alpine 3.8.2?
> 
>     coreutils does give me the "who" command, but it returns nothing,
>     even though I am logged in on the console when executing it.
> 

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: "Laurent Bercot" <[email-masked]>
Date: Thu, 10 Jan 2019 19:15:33 +0000

>The examples in the git repo show that it can be used with OpenRC although it still needs the s6-ipcserver.

  There has been a utmps package in the Alpine distribution since
August 2018.

  ... at least, that's when the patch was sent to the alpine-aports
mailing-list. I don't know if it has been processed since, because
Alpine maintainers seem to privilege GitHub PRs and hardly ever seem
to find the time and/or energy to process ML patches.

  In any case, the package is a little old and I've been late in
maintaining my packages lately, sorry about that. New versions should
arrive towards the end of this month. If they don't get lost in
patchwork limbo.

--
  Laurent

---

---

From: PICCORO McKAY Lenz <[email-masked]>
Date: Thu, 10 Jan 2019 15:37:34 -0400

> There has been a utmps package in the Alpine distribution since
seems are thefirts step only

> to find the time and/or energy to process ML patches.
ummm "quite xtrange"

> arrive towards the end of this month. If they don't get lost in
thanks for your work