Linked by diegocg on Mon 23rd Aug 2010 14:10 UTC
Linux Lennart Poettering has posted a status update about systemd, an init/upstart alternative. systemd is able now to replace /etc/fstab and cron, and it seems it will be the default init system for Fedora 14. He has also written a post about systemd for administrators.
Thread beginning with comment 437960
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[5]: I am not okay with this
by Rahul on Tue 24th Aug 2010 14:31 UTC in reply to "RE[4]: I am not okay with this"
Rahul
Member since:
2005-07-06

If you want to know why, think beyond just desktop systems. There is Linux now on PDA's, tablets, phones and so on. Executing 99% boiler plate code over and over again doesn't make any sense.

Package maintainers already have written init scripts. They don't have to convert. If they want to take advantage of systemd native service files, they could write one as well but this is hardly going to take any time at all. Here is an actual example

NetworkManager.service file for systemd
----------------------------------------

[Unit]
Description=Network Manager
After=syslog.target

[Service]
Type=dbus
BusName=org.freedesktop.NetworkManager
ExecStart=/usr/sbin/NetworkManager --no-daemon

[Install]
WantedBy=network.target multi-user.target
Alias=dbus-org.freedesktop.NetworkManager.service

----

The equivalent sysvinit script is:
-----------------------------------

#!/bin/sh
#
# NetworkManager: NetworkManager daemon
#
# chkconfig: - 23 84
# description: This is a daemon for automatically switching network \
# connections to the best available connection.
#
# processname: NetworkManager
# pidfile: /var/run/NetworkManager/NetworkManager.pid
#
### BEGIN INIT INFO
# Provides: network_manager $network
# Required-Start: messagebus
# Required-Stop: messagebus
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop NetworkManager
# Description: NetworkManager is a tool for easily managing network connections
### END INIT INFO

prefix=/usr
exec_prefix=/usr
sbindir=/usr/sbin

NETWORKMANAGER_BIN=${sbindir}/NetworkManager

# Sanity checks.
[ -x $NETWORKMANAGER_BIN ] || exit 1

# Source function library.
. /etc/rc.d/init.d/functions

# Source network configuration
. /etc/sysconfig/network

# so we can rearrange this easily
processname=NetworkManager
servicename=NetworkManager
pidfile=/var/run/NetworkManager/NetworkManager.pid

RETVAL=0

start()
{
echo -n $"Setting network parameters... "
sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1
success
echo

echo -n $"Starting NetworkManager daemon: "
daemon --pidfile $pidfile --check $servicename $processname --pid-file=$pidfile
RETVAL=$?
echo
if [ -n "${NETWORKWAIT}" ]; then
[ -z "${LINKDELAY}" ] && LINKDELAY=10
echo -n $"Waiting for network..."
nm-online -q --timeout=$LINKDELAY || nm-online -q -x --timeout=30
[ "$?" = "0" ] && success "network startup" || failure "network startup"
echo
[ -n "${NETWORKDELAY}" ] && /bin/sleep ${NETWORKDELAY}
fi
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename
}

stop()
{
echo -n $"Stopping NetworkManager daemon: "
killproc -p $pidfile $servicename
RETVAL=$?
echo
if [ $RETVAL -eq 0 ]; then
rm -f /var/lock/subsys/$servicename
rm -f $pidfile
fi
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status -p $pidfile $processname
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
if [ -f /var/lock/subsys/$servicename ]; then
stop
start
fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
;;
esac
exit $RETVAL

----

The difference is enormous. systemd code has extensive support for sysvinit scripts so that it can act as a drop in replacement and it is perfectly fine if most of the system continues to use sysvinit scripts. systemd will support them forever essentially.

Reply Parent Score: 2

sorpigal Member since:
2005-11-02

I wrote a reply to this same example on lwn, I won't repeat it here.

If you want to know why, think beyond just desktop systems.

I am thinking specifically of my servers. As for embedded, I understand that there every once of performance matters. Let them over-optimize if they must.

Package maintainers already have written init scripts. They don't have to convert.

Are the systemd developers recommending that sysvinit scripts remain in use and that people do not convert to "native" systemd? If the answer is "No" then sooner or later there will be no more init scripts written at all.

Reply Parent Score: 2

RE[7]: I am not okay with this
by Rahul on Tue 24th Aug 2010 14:45 in reply to "RE[6]: I am not okay with this"
Rahul Member since:
2005-07-06

Servers need 99% boiler plate code to be executed? Don't think so. Simple configuration wins. How would you love to have full control over the processes spawned via control groups? How about automatic service recovery? fully detailed reported of why the service failed if it did? And yes, systemd developers are not recommending everyone convert. Even in Fedora 14, only a few default packages ship with native systemd service files and the rest of the system continues to use sysv init scripts. If anyone wants to try it out, they are free to include both. Exclusivity is not needed.

Reply Parent Score: 1