Line 1: | Line 1: | ||
= Systemd migration and packaging = | = Systemd migration and packaging = | ||
Systemd has excellent man pages for all the relevant migration options as well as [[Packaging:Systemd]] so see man: | |||
systemd.special | |||
systemd.service | |||
systemd.socket | |||
systemd.target | |||
systemd.timer | |||
systemd.time | |||
systemd.unit | |||
Revision as of 15:42, 10 August 2013
Systemd migration and packaging
Systemd has excellent man pages for all the relevant migration options as well as Packaging:Systemd so see man:
systemd.special systemd.service systemd.socket systemd.target systemd.timer systemd.time systemd.unit
Sysv to systemd service migration
Setting up the migration environment for systemd services.
For sys V to systemd migration create a service.txt file with the following unmigrated ( 119 ) components in Fedora
amavisd-new bdii bitten bluez boa ceph cfengine cherokee clement conmux ctdb cyphesis dahdi-tools dhcp_probe dircproxy diskimage-builder dkim-milter dpm-dsi drbdlinks drbd ebtables etckeeper firehol fts-server globus-gatekeeper globus-gridftp-server globus-rls-server globus-scheduler-event-generator gmediaserver gofer greylistd i8kutils ibmasm imagefactory iodine iprutils koji resource-agents ltsp lvm2 mimedefang perl-mogilefs-server mom monotone moodle mysql-proxy nagios ncid nessus-core netbsd-iscsi netcf netdisco netdump-server nightview noip nordugrid-arc nxtvepg oidentd openpts openscada openser openslp opentracker orbited ovirt-engine pathfinder pcp Perlbal pgbouncer plague pnp4nagios popfile powerman psad python-carbon qpid-cpp RabbIT ratbox-services redis rinputd ris-linux root roundup rubygem-openshift-origin-node sagator ser sigul sip-redirect sipwitch sks smstools snake spampd spawn-fcgi Spawning spectrum ssbd sslogger svxlink tabled tetrinetx thebridge tinyproxy tmda torque ttywatch ulogd vblade vhostmd vmpsd voms Vuurmuur xorg-x11-xfs xrootd xtide yum-cron yum-utils zarafa
Then git clone the packages from Fedora
while read line; do git clone git://pkgs.fedoraproject.org/$line; done < services.txt
Create a separated branch to work on
while read line; do cd $line; git checkout -b systemd-timers; cd - done < services.txt
Decide which component you are going to be migrating and add your name next to it on this list
Package name | Bug Number | Port Status | Ready for Proven Packager | Proven Packager | Note |
amavisd-new | #N/A | Nobody |
No | Nobody | |
amavisd-new-snmp | #N/A | Nobody |
No | Nobody | |
bdii | #N/A | Nobody |
No | Nobody | |
bitten-slave | #N/A | Nobody |
No | Nobody | |
bluez-compat | #N/A | Nobody |
No | Nobody | |
boa | #N/A | Nobody |
No | Nobody | |
ceph | #N/A | Nobody |
No | Nobody | |
cfengine | #N/A | Nobody |
No | Nobody | |
cherokee | #N/A | Nobody |
No | Nobody | |
clement | #N/A | Nobody |
No | Nobody | |
cmirror | #N/A | Nobody |
No | Nobody | |
conmux | #N/A | Nobody |
No | Nobody | |
ctdb-tests | #N/A | Nobody |
No | Nobody | |
cyphesis | #N/A | Nobody |
No | Nobody | |
dahdi-tools | #N/A | Nobody |
No | Nobody | |
dhcp_probe | #N/A | Nobody |
No | Nobody | |
dircproxy | #N/A | Nobody |
No | Nobody | |
diskimage-builder | #N/A | Nobody |
No | Nobody | |
dkim-milter | #N/A | Nobody |
No | Nobody | |
dpm-dsi | #N/A | Nobody |
No | Nobody | |
drbdlinks | #N/A | Nobody |
No | Nobody | |
drbd-utils | #N/A | Nobody |
No | Nobody | |
ebtables | #N/A | Nobody |
No | Nobody | |
etckeeper | #N/A | Nobody |
No | Nobody | |
firehol | #N/A | Nobody |
No | Nobody | |
fts-server | #N/A | Nobody |
No | Nobody | |
globus-gatekeeper | #N/A | Nobody |
No | Nobody | |
globus-gridftp-server-progs | #N/A | Nobody |
No | Nobody | |
globus-rls-server | #N/A | Nobody |
No | Nobody | |
globus-scheduler-event-generator-progs | #N/A | Nobody |
No | Nobody | |
gmediaserver | #N/A | Nobody |
No | Nobody | |
gofer | #N/A | Nobody |
No | Nobody | |
greylistd | #N/A | Nobody |
No | Nobody | |
i8kutils | #N/A | Nobody |
No | Nobody | |
ibmasm | #N/A | Nobody |
No | Nobody | |
ifplugd | #N/A | Nobody |
No | Orphan | |
imagefactory | #N/A | Nobody |
No | Nobody | |
iodine-client | #N/A | Nobody |
No | Nobody | |
iodine-server | #N/A | Nobody |
No | Nobody | |
iprutils | #N/A | Nobody |
No | Nobody | |
koji-builder | #N/A | Nobody |
No | Nobody | |
koji-utils | #N/A | Nobody |
No | Nobody | |
koji-vm | #N/A | Nobody |
No | Nobody | |
ldirectord | #N/A | Nobody |
No | Nobody | |
ltsp-server | #N/A | Nobody |
No | Nobody | |
lvm2-cluster | #N/A | Nobody |
No | Nobody | |
mimedefang | #N/A | Nobody |
No | Nobody | |
mogilefsd | #N/A | Nobody |
No | Nobody | |
mogstored | #N/A | Nobody |
No | Nobody | |
mom | #N/A | Nobody |
No | Nobody | |
monotone-server | #N/A | Nobody |
No | Nobody | |
moodle | #N/A | Nobody |
No | Nobody | |
mysql-mmm-agent | #N/A | Nobody |
No | Nobody | ORPHAN |
mysql-mmm-monitor | #N/A | Nobody |
No | Nobody | ORPHAN |
mysql-proxy | #N/A | Nobody |
No | Nobody | |
nagios | #N/A | Nobody |
No | Nobody | |
ncid | #N/A | Nobody |
No | Nobody | |
ncid-client | #N/A | Nobody |
No | Nobody | |
ncid-samba | #N/A | Nobody |
No | Nobody | |
ncid-speak | #N/A | Nobody |
No | Nobody | |
nessus-server | #N/A | Nobody |
No | Nobody | |
netbsd-iscsi | #N/A | Nobody |
No | Nobody | |
netcf-libs | #N/A | Nobody |
No | Nobody | |
netdisco | #N/A | Nobody |
No | Nobody | |
netdump-server | #N/A | Nobody |
No | Nobody | |
nightview-server | #N/A | Nobody |
No | Nobody | |
noip | #N/A | Nobody |
No | Nobody | |
nordugrid-arc-acix-cache | #N/A | Nobody |
No | Nobody | |
nordugrid-arc-acix-index | #N/A | Nobody |
No | Nobody | |
nordugrid-arc-arex | #N/A | Nobody |
No | Nobody | |
nordugrid-arc-aris | #N/A | Nobody |
No | Nobody | |
nordugrid-arc-cache-service | #N/A | Nobody |
No | Nobody | |
nordugrid-arc-datadelivery-service | #N/A | Nobody |
No | Nobody | |
nordugrid-arc-egiis | #N/A | Nobody |
No | Nobody | |
nordugrid-arc-gridftpd | #N/A | Nobody |
No | Nobody | |
nordugrid-arc-hed | #N/A | Nobody |
No | Nobody | |
nordugrid-arc-ldap-infosys | #N/A | Nobody |
No | Nobody | |
nxtvepg | #N/A | Nobody |
No | Nobody | |
oidentd | #N/A | Nobody |
No | Nobody | |
openpts | #N/A | Nobody |
No | Nobody | |
openscada | #N/A | Nobody |
No | Nobody | |
openser | #N/A | Nobody |
No | Nobody | |
openslp-server | #N/A | Nobody |
No | Nobody | |
opentracker-ipv4 | #N/A | Nobody |
No | Nobody | |
opentracker-ipv6 | #N/A | Nobody |
No | Nobody | |
orbited | #N/A | Nobody |
No | Nobody | |
ovirt-engine-notification-service | #N/A | Nobody |
No | Nobody | |
pathfinderd | #N/A | Nobody |
No | Nobody | |
pcp | #N/A | Nobody |
No | Nobody | |
Perlbal | #N/A | Nobody |
No | Nobody | |
pgbouncer | #N/A | Nobody |
No | Nobody | |
plague | #N/A | Nobody |
No | Nobody | |
plague-builder | #N/A | Nobody |
No | Nobody | |
pnp4nagios | #N/A | Nobody |
No | Nobody | |
popfile | #N/A | Nobody |
No | Nobody | |
powerman | #N/A | Nobody |
No | Nobody | |
preload | #N/A | Nobody |
No | Nobody | ORPHAN |
psad | #N/A | Nobody |
No | Nobody | |
python-carbon | #N/A | Nobody |
No | Nobody | |
qpid-cpp-server-ha | #N/A | Nobody |
No | Nobody | |
RabbIT | #N/A | Nobody |
No | Nobody | |
ratbox-services | #N/A | Nobody |
No | Nobody | |
redis | #N/A | Nobody |
No | Nobody | |
rinputd | #N/A | Nobody |
No | Nobody | |
ris-linux | #N/A | Nobody |
No | Nobody | |
root-proofd | #N/A | Nobody |
No | Nobody | |
root-rootd | #N/A | Nobody |
No | Nobody | |
roundup | #N/A | Nobody |
No | Nobody | |
rubygem-openshift-origin-node | #N/A | Nobody |
No | Nobody | |
sagator-core | #N/A | Nobody |
No | Nobody | |
ser | #N/A | Nobody |
No | Nobody | |
sigul | #N/A | Nobody |
No | Nobody | |
sip-redirect | #N/A | Nobody |
No | Nobody | |
sipwitch | #N/A | Nobody |
No | Nobody | |
sks | #N/A | Nobody |
No | Nobody | |
smstools | #N/A | Nobody |
No | Nobody | |
snake-server | #N/A | Nobody |
No | Nobody | |
spampd | #N/A | Nobody |
No | Nobody | |
spawn-fcgi | #N/A | Nobody |
No | Nobody | |
Spawning | #N/A | Nobody |
No | Nobody | |
spectrum | #N/A | Nobody |
No | Nobody | |
ssbd | #N/A | Nobody |
No | Nobody | |
sslogger-slogd | #N/A | Nobody |
No | Nobody | |
svxlink-server | #N/A | Nobody |
No | Nobody | |
tabled | #N/A | Nobody |
No | Nobody | |
tetrinetx | #N/A | Nobody |
No | Nobody | |
thebridge | #N/A | Nobody |
No | Nobody | |
tinyproxy | #N/A | Nobody |
No | Nobody | |
tmda-ofmipd | #N/A | Nobody |
No | Nobody | |
torque-mom | #N/A | Nobody |
No | Nobody | |
torque-scheduler | #N/A | Nobody |
No | Nobody | |
torque-server | #N/A | Nobody |
No | Nobody | |
ttywatch | #N/A | Nobody |
No | Nobody | |
ulogd | #N/A | Nobody |
No | Nobody | |
vblade | #N/A | Nobody |
No | Nobody | |
vhostmd | #N/A | Nobody |
No | Nobody | |
vmpsd | #N/A | Nobody |
No | Nobody | |
voms-server | #N/A | Nobody |
No | Nobody | |
Vuurmuur-daemon | #N/A | Nobody |
No | Nobody | |
xorg-x11-xfs | #N/A | Nobody |
No | Nobody | |
xrootd | #N/A | Nobody |
No | Nobody | |
xtide | #N/A | Nobody |
No | Nobody | |
yum-cron | #N/A | Nobody |
No | Nobody | |
yum-updateonboot | #N/A | Nobody |
No | Nobody | |
zarafa-dagent | #N/A | Nobody |
No | Nobody | |
zarafa-gateway | #N/A | Nobody |
No | Nobody | |
zarafa-ical | #N/A | Nobody |
No | Nobody | |
zarafa-monitor | #N/A | Nobody |
No | Nobody | |
zarafa-search | #N/A | Nobody |
No | Nobody | |
zarafa-server | #N/A | Nobody |
No | Nobody | |
zarafa-spooler | #N/A | Nobody |
No | Nobody |
Spec file changes
[...] Source1: ackme.service BuildRequires: systemd Requires(post): systemd Requires(preun): systemd Requires(postun): systemd [...] %install mkdir -p %{buildroot}%{_unitdir} %{__install} -p -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir} %post %systemd_post %preun %systemd_preun %postun %systemd_postun %files %{_unitdir}/ackme.service %{_unitdir}/ackme.timer [...]
Cron job to timer migration
When to migrate
Setting up the migration environment for systemd timers.
For timer migration create a timers.txt file with the following content.
amavisd-new apt arm4 atop bcfg2 clement cyrus-imapd dbmail denyhosts dspam exim fetch-crl freeipa hylafax+ inn leafnode ltsp mailman mcelog mdadm mldonkey newscache nsd opendnssec openvas-scanner ovirt-engine ovirt-node polipo sagator sipwitch spamassassin squidGuard subscription-manager sysstat vdsm vnstat yum-cron
Then git clone the packages from Fedora
while read line do git clone git://pkgs.fedoraproject.org/$line; done < timers.txt
Create a separated branch to work on
while read line do cd $line; git checkout -b systemd-timers; cd - done < timers.txt
Decide which component you are going to be migrating and add your name next to it on this list
Package name | Bug Number | Port Status | Ready for Proven Packager | Proven Packager | Note |
amavisd-new | #N/A | Nobody |
No | Nobody | drop cron use tmpfile |
apt | #991684 | Yes | Nobody | ||
arm4 | #991696 | Yes | Nobody | ||
atop | #N/A | Nobody |
No | Nobody | Cron job restarts service could potentially be a feature |
bcfg2 | #N/A | Nobody |
No | Nobody | |
clement | #N/A | Nobody |
No | Nobody | |
cyrus-imapd | #N/A | Nobody |
No | Nobody | |
dbmail | #N/A | Nobody |
No | Nobody | |
denyhosts | #N/A | Nobody |
No | Nobody | |
dspam | #N/A | Nobody |
No | Nobody | |
exim | #N/A | Nobody |
No | Nobody | |
fetch-crl | #N/A | Nobody |
No | Nobody | |
freeipa-server | #N/A | Nobody |
No | Nobody | |
hylafax+ | #N/A | Nobody |
No | Nobody | |
inn | #N/A | Nobody |
No | Nobody | |
leafnode | #N/A | Nobody |
No | Nobody | |
ltsp-server | #N/A | Nobody |
No | Nobody | |
mailman | #N/A | Nobody |
No | Nobody | |
mcelog | #N/A | Nobody |
No | Nobody | |
mdadm | #N/A | Nobody |
No | Nobody | |
mldonkey-server | #N/A | Nobody |
No | Nobody | |
newscache | #N/A | Nobody |
No | Nobody | |
nsd | #N/A | Nobody |
No | Nobody | |
opendnssec | #N/A | Nobody |
No | Nobody | |
openvas-scanner | #N/A | Nobody |
No | Nobody | |
ovirt-engine | #N/A | Nobody |
No | Nobody | |
ovirt-node | #N/A | Nobody |
No | Nobody | |
polipo | #N/A | Nobody |
No | Nobody | |
sagator-core | #N/A | Nobody |
No | Nobody | |
sipwitch | #N/A | Nobody |
No | Nobody | |
spamassassin | #N/A | Nobody |
No | Nobody | |
squidGuard | #N/A | Nobody |
No | Nobody | |
subscription-manager | #N/A | Nobody |
No | Nobody | |
sysstat | #N/A | Nobody |
No | Nobody | |
vdsm-reg | #N/A | Nobody |
No | Nobody | |
vnstat | #N/A | Nobody |
No | Nobody | |
yum-cron | #N/A | Nobody |
No | Nobody |
Add the timer unit to git
git add ackme-job.service git add ackme-job.timer
Commit the change and create a patch.
git commit -a -m "Migrating cron job to native systemd units" git format-patch -s -n master..systemd-timers
Push the patch or file a bug in Fedora and add it to the Timer Migration Tracking Bug by setting 991679 as an blocker in that report.
Unit migration/Creation
Manual activation of timer units
systemctl enable ackme.timer
Starting the timer unit
systemctl start ackme.timer
Enablement of timer units by default is handled by presets
Spec file changes
[...] Source1: ackme.service Source2: ackme.timer BuildRequires: systemd Requires(post): systemd Requires(preun): systemd Requires(postun): systemd [...] %install mkdir -p %{buildroot}%{_unitdir} %{__install} -p -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir} %{__install} -p -D -m 644 %{SOURCE2} %{buildroot}%{_unitdir} %post %systemd_post %preun %systemd_preun %postun %systemd_postun %files %{_unitdir}/ackme.service %{_unitdir}/ackme.timer [...]
Various Timer unit samples
Bound to another service
ackme.service:
[Unit] Description=Ackme Sample Service Documentation=man:ackmed(1) [Service] ExecStart=/usr/bin/ackmed [Install] WantedBy=multi-user.target
ackme-job.timer
[Unit] Description=Ackme Sample Timer Trigger Documentation=man:ackmed(1) BindTo=ackme.service [Timer] OnCalendar=daily [Install] WantedBy=ackme.service
ackme-job.service
[Unit] Description=Daily ackme Job Documentation=man:ackmed(1) [Service] User=ackme ExecStart=/usr/bin/acme-job
After Boot Time Trigger
ackme-job.timer
[Unit] Description=Ackme Sample Timer Trigger 5 Minutes After Boot Documentation=man:ackmed(1) BindTo=ackme.service [Timer] OnBootSec=5m [Install] WantedBy=timers.target
ackme-job.service
[Unit] Description=Daily Sample Ackme Job Documentation=man:ackmed(1) [Service] User=ackme ExecStart=/usr/bin/acme-job
After Boot + Hourly Time Trigger
ackme-job.timer
[Unit] Description=Ackme Sample Timer Trigger 5 Minutes After Boot And Hourly After That Documentation=man:ackmed(1) BindTo=ackme.service [Timer] OnBootSec=5m OnUnitActiveSec=1h [Install] WantedBy=timers.target
ackme-job.service
[Unit] Description=Daily Sample Ackme Job Documentation=man:ackmed(1) [Service] User=ackme ExecStart=/usr/bin/acme-job
Traditional Hourly
[Unit] Description=Ackme Sample Timer Trigger Documentation=man:ackmed(1) [Timer] OnCalendar=hourly [Install] WantedBy=timers.target
ackme-job.service
[Unit] Description=Daily Ackme Sample Job Documentation=man:ackmed(1) [Service] User=ackme ExecStart=/usr/bin/acme-job
Traditional Daily
[Unit] Description=Ackme Sample Timer Unit Documentation=man:ackmed(1) [Timer] OnCalendar=daily [Install] WantedBy=ackme.service
ackme-job.service
[Unit] Description=Daily ackme time trigger Documentation=man:ackmed(1) [Service] User=ackme ExecStart=/usr/bin/ackme-job
Traditional Weekly
[Unit] Description=Ackme Sample Timer Unit Documentation=man:ackmed(1) [Timer] OnCalendar=weekly [Install] WantedBy=timers.target
ackme-job.service
[Unit] Description=Daily ackme time trigger Documentation=man:ackmed(1) [Service] User=ackme ExecStart=/usr/bin/ackme-job
Traditional Monthly
[Unit] Description=Ackme Sample Timer Trigger Documentation=man:acmed(1) [Timer] OnCalendar=monthly [Install] WantedBy=timers.target
ackme-job.service
[Unit] Description=Monthly Ackme Sample Job Documentation=man:acmed(1) [Service] User=ackme ExecStart=/usr/bin/ackme-job