On Sat, 9 Nov 2019 10:11:46 +0100, "R.Wieser"
declaimed the following:
>Is that "upgrading" ment as in the boot process, or should I take that as
>meaning that raspbian itself is considered an in-between step to something
>else ?
>
It's between using Sys-V init.d only and using systemd only... And I
should note that there is a systemd descriptor file that invokes
fake-hwclock, so even the init.d variant may not be used...
And different web pages have different takes on S level -- being either
start-up (before getting to a user run-level) or equivalent to level 1...
Level 2-4 can be ignored since all three are considered systemd
multiuser.target, 5 is graphical.target (which requires multiuser.target).
>> When /entering/ run-level S, S01fake-hwclock will be invoked with
>> the "start" parameter.
>> When entering run-level 0, 1, or 6, K01fake-hwclock will be invoked
>> with the "stop" parameter.
>
>In short, when entering run-level 1 it will get started *and* stopped.
>Which could make sense in fake-hwclock's case.
>
Under init.d, possibly... but under systemd those run-level scripts are
only processed if invoked by the systemd setups -- and systemd doesn't
appear to enter run level 1 before going to run level 5. Using the command
to display previous/current run level showed
N 5
(No run level) (direct to level 5/graphical).
Here's the systemd fake-hwclock service description...
pi@rpi3bplus-1:~$ cat /lib/systemd/system/fake-hwclock.service
[Unit]
Description=Restore / save the current clock
Documentation=man:fake-hwclock(8)
DefaultDependencies=no
Before=sysinit.target systemd-fsck-root.service
Conflicts=shutdown.target
[Service]
EnvironmentFile=-/etc/default/fake-hwclock
ExecStart=/sbin/fake-hwclock load $FORCE
ExecStop=/sbin/fake-hwclock save
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=sysinit.target
pi@rpi3bplus-1:~$
Note the "Before=sysinit.target" line. This indicates that this service
has to run before the rest of sysinit, and even before the boot-up
systemd-fsck-root check (in order to give the system a time stamp that is
close to the time stamp of the root file system). I suspect the "Conflicts"
line is what sets this to run the stop action if systemd is activating the
shutdown.target.
>
>Grumble ... I tried "man init.d" and got nothing. Didn't think to do the
>same for update-rc.d though. :-\
>
Nothing? I get "No manual entry for init.d"... But yeah... Sys-V init
is so low-level it has no useful runtime information. The closest is
probably
pi@rpi3bplus-1:~$ apropos init.d
git-init-db (1) - Creates an empty Git repository
init-d-script (5) - interpreter for short and simple init.d scripts.
initrd (4) - boot loader initialized RAM disk
pi@rpi3bplus-1:~$ man init-d-script
NAME
init-d-script - interpreter for short and simple init.d scripts.
DESCRIPTION
Generic init.d script framework to reduce the redundant code in
/etc/init.d/. The
goal is to create an init.d script that is Debian and LSB compliant.
When the Debian
policy conflict with the LSB, the Debian policy take preference. See
The LSB specifi-
cation
?http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-
generic/iniscrptact.html? for information about init.d scripts in
the LSB.
This is a simple example on how init-d-script can be used to start
and stop a daemon
with PID file support:
#!/usr/bin/env /lib/init/init-d-script
### BEGIN INIT INFO
# Provides: atd
# Required-Start: $syslog $time $remote_fs
# Required-Stop: $syslog $time $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: run at jobs
# Description: Debian init script to start the daemon
# running at jobs.
### END INIT INFO
DAEMON=/usr/sbin/atd
(Of course, there are more pages of stuff)
>> See the insserv(8) manual page for details about the LSB header format.
>
>Bingo! Or maybe not: "man insserv" -> "No manual entry for insserv" ?
>
Debian tends to override pure LSB, with the result that stuff aimed at
LSB tends to not be present (not even as a package to be installed) -- one
reason I tend to hit Google first.
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|