How to run fake-hwclock before /var/log/wtmp is updated?
Clash Royale CLAN TAG#URR8PPP
up vote
7
down vote
favorite
I have a raspberry pi and every reboot I see this output in last:
root@RaspberryPi:~# last | grep boot
reboot system boot 4.4.0-1055-raspi Thu Jan 1 01:00 still running
reboot system boot 4.4.0-1055-raspi Thu Jan 1 01:00 still running
reboot system boot 4.4.0-1055-raspi Thu Jan 1 01:00 - 23:01 (17305+22:01)
reboot system boot 4.4.0-1055-raspi Thu Jan 1 01:00 - 23:01 (17305+22:01)
reboot system boot 4.4.0-1055-raspi Thu Jan 1 01:00 - 23:01 (17305+22:01)
This is despite having both fake-hwclock and a hardware RTC installed.
Currently the service for fake-hwclock.service starts before sysinit.target, like this:
[Unit]
Before=sysinit.target
[Service]
ExecStart=/sbin/fake-hwclock load
[Install]
WantedBy=sysinit.target
How do I make it run before /var/log/wtmp is updated?
systemd raspberry-pi wtmp
add a comment |Â
up vote
7
down vote
favorite
I have a raspberry pi and every reboot I see this output in last:
root@RaspberryPi:~# last | grep boot
reboot system boot 4.4.0-1055-raspi Thu Jan 1 01:00 still running
reboot system boot 4.4.0-1055-raspi Thu Jan 1 01:00 still running
reboot system boot 4.4.0-1055-raspi Thu Jan 1 01:00 - 23:01 (17305+22:01)
reboot system boot 4.4.0-1055-raspi Thu Jan 1 01:00 - 23:01 (17305+22:01)
reboot system boot 4.4.0-1055-raspi Thu Jan 1 01:00 - 23:01 (17305+22:01)
This is despite having both fake-hwclock and a hardware RTC installed.
Currently the service for fake-hwclock.service starts before sysinit.target, like this:
[Unit]
Before=sysinit.target
[Service]
ExecStart=/sbin/fake-hwclock load
[Install]
WantedBy=sysinit.target
How do I make it run before /var/log/wtmp is updated?
systemd raspberry-pi wtmp
1
Filed an issue here, so far no solutions :( < github.com/systemd/systemd/issues/6057
â Roman Gaufman
Jun 7 '17 at 16:13
add a comment |Â
up vote
7
down vote
favorite
up vote
7
down vote
favorite
I have a raspberry pi and every reboot I see this output in last:
root@RaspberryPi:~# last | grep boot
reboot system boot 4.4.0-1055-raspi Thu Jan 1 01:00 still running
reboot system boot 4.4.0-1055-raspi Thu Jan 1 01:00 still running
reboot system boot 4.4.0-1055-raspi Thu Jan 1 01:00 - 23:01 (17305+22:01)
reboot system boot 4.4.0-1055-raspi Thu Jan 1 01:00 - 23:01 (17305+22:01)
reboot system boot 4.4.0-1055-raspi Thu Jan 1 01:00 - 23:01 (17305+22:01)
This is despite having both fake-hwclock and a hardware RTC installed.
Currently the service for fake-hwclock.service starts before sysinit.target, like this:
[Unit]
Before=sysinit.target
[Service]
ExecStart=/sbin/fake-hwclock load
[Install]
WantedBy=sysinit.target
How do I make it run before /var/log/wtmp is updated?
systemd raspberry-pi wtmp
I have a raspberry pi and every reboot I see this output in last:
root@RaspberryPi:~# last | grep boot
reboot system boot 4.4.0-1055-raspi Thu Jan 1 01:00 still running
reboot system boot 4.4.0-1055-raspi Thu Jan 1 01:00 still running
reboot system boot 4.4.0-1055-raspi Thu Jan 1 01:00 - 23:01 (17305+22:01)
reboot system boot 4.4.0-1055-raspi Thu Jan 1 01:00 - 23:01 (17305+22:01)
reboot system boot 4.4.0-1055-raspi Thu Jan 1 01:00 - 23:01 (17305+22:01)
This is despite having both fake-hwclock and a hardware RTC installed.
Currently the service for fake-hwclock.service starts before sysinit.target, like this:
[Unit]
Before=sysinit.target
[Service]
ExecStart=/sbin/fake-hwclock load
[Install]
WantedBy=sysinit.target
How do I make it run before /var/log/wtmp is updated?
systemd raspberry-pi wtmp
systemd raspberry-pi wtmp
asked May 30 '17 at 20:24
Roman Gaufman
1349
1349
1
Filed an issue here, so far no solutions :( < github.com/systemd/systemd/issues/6057
â Roman Gaufman
Jun 7 '17 at 16:13
add a comment |Â
1
Filed an issue here, so far no solutions :( < github.com/systemd/systemd/issues/6057
â Roman Gaufman
Jun 7 '17 at 16:13
1
1
Filed an issue here, so far no solutions :( < github.com/systemd/systemd/issues/6057
â Roman Gaufman
Jun 7 '17 at 16:13
Filed an issue here, so far no solutions :( < github.com/systemd/systemd/issues/6057
â Roman Gaufman
Jun 7 '17 at 16:13
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
0
down vote
I believe that this is a bug in systemd-update-utmp. See my comment here: https://github.com/systemd/systemd/issues/6057#issuecomment-435247567
A workaround is to run fake-hwclock in initramfs, before it passes control to the main systemd instance.
add a comment |Â
up vote
-1
down vote
wtmp "reboot" login records are handled by the systemd-update-utmp systemd service. It must start before the sysinit target which means before that start is complete this service will start IF it wasn't started already. It does not mean that systemd-timesyncd will necessarily start before systemd-update-utmp.
I tested on my arch linux server and consistently systemd-timesyncd always runs well before systemd-update-utmp however. On the other hand they are almost always one pid away from each other.
But since it isn't explicitly running after NTP I suppose this should still be considered a bug.
From the systemd manual:
"After= is the inverse of Before=, i.e. while After= ensures that the configured unit is started after the listed unit finished starting up"
https://www.freedesktop.org/software/systemd/man/systemd.unit.html
What you should do:
systemctl edit systemd-update-utmp
[Unit]
After=systemd-timesyncd.service
Wants=systemd-timesyncd.service
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
I believe that this is a bug in systemd-update-utmp. See my comment here: https://github.com/systemd/systemd/issues/6057#issuecomment-435247567
A workaround is to run fake-hwclock in initramfs, before it passes control to the main systemd instance.
add a comment |Â
up vote
0
down vote
I believe that this is a bug in systemd-update-utmp. See my comment here: https://github.com/systemd/systemd/issues/6057#issuecomment-435247567
A workaround is to run fake-hwclock in initramfs, before it passes control to the main systemd instance.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
I believe that this is a bug in systemd-update-utmp. See my comment here: https://github.com/systemd/systemd/issues/6057#issuecomment-435247567
A workaround is to run fake-hwclock in initramfs, before it passes control to the main systemd instance.
I believe that this is a bug in systemd-update-utmp. See my comment here: https://github.com/systemd/systemd/issues/6057#issuecomment-435247567
A workaround is to run fake-hwclock in initramfs, before it passes control to the main systemd instance.
answered 2 mins ago
Piotr Jurkiewicz
686512
686512
add a comment |Â
add a comment |Â
up vote
-1
down vote
wtmp "reboot" login records are handled by the systemd-update-utmp systemd service. It must start before the sysinit target which means before that start is complete this service will start IF it wasn't started already. It does not mean that systemd-timesyncd will necessarily start before systemd-update-utmp.
I tested on my arch linux server and consistently systemd-timesyncd always runs well before systemd-update-utmp however. On the other hand they are almost always one pid away from each other.
But since it isn't explicitly running after NTP I suppose this should still be considered a bug.
From the systemd manual:
"After= is the inverse of Before=, i.e. while After= ensures that the configured unit is started after the listed unit finished starting up"
https://www.freedesktop.org/software/systemd/man/systemd.unit.html
What you should do:
systemctl edit systemd-update-utmp
[Unit]
After=systemd-timesyncd.service
Wants=systemd-timesyncd.service
add a comment |Â
up vote
-1
down vote
wtmp "reboot" login records are handled by the systemd-update-utmp systemd service. It must start before the sysinit target which means before that start is complete this service will start IF it wasn't started already. It does not mean that systemd-timesyncd will necessarily start before systemd-update-utmp.
I tested on my arch linux server and consistently systemd-timesyncd always runs well before systemd-update-utmp however. On the other hand they are almost always one pid away from each other.
But since it isn't explicitly running after NTP I suppose this should still be considered a bug.
From the systemd manual:
"After= is the inverse of Before=, i.e. while After= ensures that the configured unit is started after the listed unit finished starting up"
https://www.freedesktop.org/software/systemd/man/systemd.unit.html
What you should do:
systemctl edit systemd-update-utmp
[Unit]
After=systemd-timesyncd.service
Wants=systemd-timesyncd.service
add a comment |Â
up vote
-1
down vote
up vote
-1
down vote
wtmp "reboot" login records are handled by the systemd-update-utmp systemd service. It must start before the sysinit target which means before that start is complete this service will start IF it wasn't started already. It does not mean that systemd-timesyncd will necessarily start before systemd-update-utmp.
I tested on my arch linux server and consistently systemd-timesyncd always runs well before systemd-update-utmp however. On the other hand they are almost always one pid away from each other.
But since it isn't explicitly running after NTP I suppose this should still be considered a bug.
From the systemd manual:
"After= is the inverse of Before=, i.e. while After= ensures that the configured unit is started after the listed unit finished starting up"
https://www.freedesktop.org/software/systemd/man/systemd.unit.html
What you should do:
systemctl edit systemd-update-utmp
[Unit]
After=systemd-timesyncd.service
Wants=systemd-timesyncd.service
wtmp "reboot" login records are handled by the systemd-update-utmp systemd service. It must start before the sysinit target which means before that start is complete this service will start IF it wasn't started already. It does not mean that systemd-timesyncd will necessarily start before systemd-update-utmp.
I tested on my arch linux server and consistently systemd-timesyncd always runs well before systemd-update-utmp however. On the other hand they are almost always one pid away from each other.
But since it isn't explicitly running after NTP I suppose this should still be considered a bug.
From the systemd manual:
"After= is the inverse of Before=, i.e. while After= ensures that the configured unit is started after the listed unit finished starting up"
https://www.freedesktop.org/software/systemd/man/systemd.unit.html
What you should do:
systemctl edit systemd-update-utmp
[Unit]
After=systemd-timesyncd.service
Wants=systemd-timesyncd.service
answered Nov 26 '17 at 9:52
jdwolf
2,560216
2,560216
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f368190%2fhow-to-run-fake-hwclock-before-var-log-wtmp-is-updated%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
Filed an issue here, so far no solutions :( < github.com/systemd/systemd/issues/6057
â Roman Gaufman
Jun 7 '17 at 16:13