On Mon, 2014-11-03 at 02:50 +0200, Mert Dirik wrote:
> I'm attaching a two different versions of the patch.
> 
> First version (v1), reads /proc/1/comm to check if it's systemd or init. 
> A potential problem with this approach is that the /proc/<pid>/comm 
> interface works on only linux 2.6.33+. I don't know if it's really a 
> problem.

Relying upon systemd being PID 1 is not a good idea. One of these days
someone will come up with reasons and ways to run systemd as PID other
than 1 and kexec will break again.

> 
> Second approach reads the output of "systemctl is-system-running" 
> command. This command will print "stopping" if systemd is the init and 
> the system is shutting down or rebooting. Otherwise (if systemd is not 
> init or systemd is not installed at all, so the command doesn't exist) 
> it will fail so the if check will fail.

Does this approach work if someone installs systemd as well as SysV init
but disables systemd? I played with a few combinations of both installed
on a system with different ways of disabling them and I found I could
not rely upon presence of systemctl as a reliable indicator of whether
systemd is installed and enabled or not.

> 
> I tested both patch in varying scenarios (sysvinit as pid 1 with systemd 
> installed, sysvinit as pid 1 with nothing else, systemd as pid 1 as 
> /sbin/init, systemd as pid 1 but not /sbin/init) and didn't encountered 
> any problem.
> 
> Why systemd runs /etc/rc6.d/K01kexec-load and /etc/rc6.d/K10kexec on 
> reboot is still a mystery to me.
> 

--
Khalid


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to