[HEADS-UP] systemd for F14 - the next steps

"Jóhann B. Guðmundsson" johannbg at gmail.com
Wed Jul 21 12:04:39 UTC 2010


  On 07/21/2010 03:24 AM, Toshio Kuratomi wrote:
> I have a few requests for things to add to that page :-)
>
> * What replaces chkconfig


systemd-install

Now first the gotcha then I'll provide chkconfig replacement example.

Admins will need to know that they have to use chkconfig for services 
that do not have a native systemd $service file. ( legacy for services )

And as the general rule goes "native configuration breaks legacy 
configuration" so if a native systemd $service file does exist than 
changing service via chkconfig no longer will work.

Now the systemd developers could add a little pony to speed up adoption 
and prevent potential chkconfig Admin/User fiasco by simply letting 
systemd-install fallback to chkconfig if it finds no native service file 
in /lib/systemd/system/ with msg to stdout asking Admins to file a bug 
against a given missing service.

Admins/Users could then stop using chkconfig and use systemd-install 
only instead which would speed up adobtion

Systemd-install examples ( see man page for detail list of options )

To see running targets on your system.

systemctl list-units --type=target

To see all available running targets on your system.

systemctl list-units --type=target --all

To see which native systemd system files exist on your installed system

ls /lib/systemd/system/

To enable service ( chkconfig $service on )

systemd-install enable $service.service

To disable service ( chkconfig $service off )

systemd-install disable $service.service

To enable service and start it ( chkconfig $service on && service 
$service start )

systemd-install --realize=yes enable $service.service

To always start service on boot instead of when a connection comes in or 
some hardware is plugged in.

ln -sf /lib/systemd/system/foobar.service 
/etc/systemd/system/multi-user.target.wants/foobar.service

Remember to reload the systemd manager

systemctl daemon-reload

So to enable avahi-daemon

systemd-install enable avahi-daemon.service

To disable avahi-daemon

systemd-install disable avahi-daemon.service

To enable avahi-daemon and start it

systemd-install --realize=yes enable avahi-daemon.service

To always start avahi-daemon on boot

ln -sf /lib/systemd/system/avahi-daemon.service 
/etc/systemd/system/multi-user.target.wants/avahi-daemon.service

Reload the systemd manager

systemctl daemon-reload

> * What replaces /etc/init.d/SERVICENAME start | stop ?
>

systemctl.

systemctl examples ( sem man pages for detail list of options )

Replacing traditional /sbin/service with systemctl

To list running services

systemctl list-units --type=service

To list all available services

systemctl list-units --type=service --all

To start a  service

systemctl start $foo.service

To stop a service

systemctl stop $foo.service

To reload a service .conf file.

systemctl reload $foo.service

To restart a service

systemctl restart $foo.service

To show service status ( Admins should love the output from this )

systemctl status $foo.service

Using Apache as an example

Starting Apache

systemctl start httpd.service

Stopping Apache

systemctl stop httpd.service

Reloading httpd.conf

systemctl reload httpd.service

Restarting Apache

systemctl restart httpd.service

To check if Apache is running

systemct status httpd.service

I will add this ( and more ) to the page soon as can.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/devel/attachments/20100721/3c344cd4/attachment.html 


More information about the devel mailing list