Mail archive
alpine-user

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

From: Vincent Bentley <vince_at_vincentbentley.co.uk>
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:
> https://bugs.alpinelinux.org/issues/3282
>
>
> El jue., 10 de ene. de 2019 a la(s) 10:45, Martin Gignac
> (martin.gignac_at_gmail.com <mailto:martin.gignac_at_gmail.com>) escribió:
>
> 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
>


---
Unsubscribe:  alpine-user+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-user+help_at_lists.alpinelinux.org
---
Received on Thu Jan 10 2019 - 17:06:09 UTC