<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Josh Triplett <<a href="mailto:josh@joshtriplett.org">josh@joshtriplett.org</a>> ha scritto:<br></div><div dir="ltr">> sysvinit works similarly, with /lib/sysvinit/init</div><div>This was in Jessie, but I don't see any /lib/sysvinit/init in Stretch nor in Sid, </div><div>it's /sbin/init now, am I wrong?</div><div><br></div><div><span style="color:rgb(80,0,80)">Dmitry Bogatov wrote:</span><br></div><div>>I propose to replace current approach with update-alternatives(1)<br>>approach.  By coordinated effort of present init systems (in thread), we<br>>introduce master link /sbin/init and number of slave links:<br>><br>>       /sbin/halt<br>>      /sbin/poweroff</div><div>>      ....</div><div><br></div><div>A slightly different approach is also possible:</div><div>Ship only /sbin/init as a alternative link ("the default init" as user choice)</div><div>and ship in `init-system-helpers' the following </div><div><br></div><div>        /sbin/halt<br>        /sbin/poweroff<br>        /sbin/reboot<br>        /sbin/runlevel<br>        /sbin/shutdown<br></div><div><br></div><div>as programs that check for the current running init and </div><div>then execute the proper command. For example</div><div>/sbin/reboot</div><div>#!/bin/sh</div><div># systemd</div><div><div>if [ -d /run/systemd/system ]; then</div><div>   exec /bin/systemctl reboot</div><div>fi</div><div><br></div><div>#sysv</div><div>if [ -p /run/initctl ]; then</div><div>   exec /sbin/sysv-reboot</div><div>fi</div><div><br></div><div>#runit</div><div>if [ -e /run/runit.stopit ]; then</div><div>   exec /sbin/runit-init 6</div><div>fi</div><div><br></div><div>#openrc</div><div>#if [ test for openrc ]</div><div>#     exec 'openrc code for reboot'</div><div># fi</div></div><div><br></div><div>Of course this require that each init rename it's /sbin/reboot</div><div>into something else: systemd already comply, sysv and runit</div><div>require some change, and I don't know about Openrc.</div><div><br></div><div><br></div><div>       </div></div></div></div>