On Tue, 20.07.10 20:24, Toshio Kuratomi (a.badger@xxxxxxxxx) wrote: > On Wed, Jul 14, 2010 at 2:50 PM, Adam Williamson <awilliam@xxxxxxxxxx> wrote: > > On Wed, 2010-07-14 at 15:42 -0600, Kevin Fenzi wrote: > > > >> Perhaps someone could put together a wiki page for lazy sysadmins with > >> a Q&A? ie, I used to do this in upstart/sysvinit, how do I do it with > >> systemd? > > > > Jóhann Guðmundsson (viking_ice) has been working on something along > > these lines: > > > > http://fedoraproject.org/wiki/User:Johannbg/QA/Systemd > > > > it was mentioned in the QA meeting a few weeks back. > > I have a few requests for things to add to that page :-) > > * What replaces chkconfig > * What replaces /etc/init.d/SERVICENAME start | stop ? > > Similarly, for packaging guidelines updates, how do we install > packages that provide services and have them not start up? The longer answers for most of these questions you find in Jóhann's reply. But a few additional notes: - If you only install a SysV init script, then continue to use chkconfig as usual. It works as intended to enable/disable SysV init scripts. Only if you use native systemd unit files you should use systemd-install instead. Note that most operations systemd-install executes are very easy however, as all it does is creating/removing a few suggested symlinks which are listed in a [Install] section in the unit file. It is OK and even expected to manually create additional symlinks, or remove symlinks, as the administrator likes. - Regardless whether systemd or SysV init scripts/unit files are used, "systemctl start" and "systemctl stop" are the recommended replacements for "service foo start" and "service foo stop". Howver, as soon as https://bugzilla.redhat.com/show_bug.cgi?id=612728 is fixed you can use the old syntax for SysV scripts too in which case the right thing happens, but you'll get a blurb printed that suggests you to use "systemctl" instead, the next time. - If you want to enable and possibly start a service from the %post of an RPM then use the "systemd-install enable" command, which will create a few symlinks as listed in the [Install] section of the unit file. On top of that you may also pass --realize=... to the command, which allows you to not only enable the unit for the next boot, but also have the changes take effect immediately: i.e. --realize=reload is the very least you should use, which simply makes systemd aware of the changed symlinks. Then, at time of %preun you should use --realize=yes which makes sure the daemon is stopped in deinstallation. For a few daemons it makes sense to restart them if they are running already during upgrade. Use --realize=minimal for those. For even others (usually very low-level ones) it might even make sense to start them right-away after installation, even if they were not running before. For those use --realize=maybe. But which option you use really depends on the package. Most packages should probably stick to --realize=yes on %preun and --realize=reload in %post. Suggested .spec file fragments you find in the daemon(7) man page. Lennart -- Lennart Poettering - Red Hat, Inc. -- devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/devel