Description of problem: Let's get the ball rolling on this one... http://fedoraproject.org/wiki/Features/SysVtoSystemd https://fedoraproject.org/wiki/Packaging:Guidelines:Systemd https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Created attachment 561458 [details] Native systemd service file for monotone Let's start with this one. The rest of the init script needs to be split out to seperate script which the users runs by hand ( monotone-init,sh and monotone-genkey.sh montone-migrate.sh )
The sysv init file does automatically create a database and a key, or moves and migrates the database if necessary upon start. Do you see any way this can also be done using systemd?
It can be done via two methods You can create a separated Type=oneshot units ( monotone-keygen.service and monotone-upgrade.service ) with or without conditions something like... ### monotone-keygen.service ### [Unit] Description=Monotone Key Generator [Service] Type=oneshot ExecStart=/path/to/script RemainAfterExit=yes [Install] WantedBy=multi-user.target ### monotone-initialdb.service ### [Unit] Description=Monotone Create InitialDB [Service] Type=oneshot ExecStart=/path/to/script RemainAfterExit=yes [Install] WantedBy=multi-user.target Then you would add "Wants=monotone-keygen.service monotone-upgrade.service" to the [Unit] Section and also add monotone-keygen.service monotone-initialdb.service to the After= line in the [Unit] section. Or you can create one shell script that does all the above and add "ExecStartPre=-/path/to/script" to the [Service] section ( above the ExecStart= line ) in the monotone.service. Pay attention to the "-" before the / in the ExecStartPre= line if you skip it the service will fail to start if the relevant script does not exit cleanly.
(In reply to comment #3) > It can be done via two methods s/upgrade/initaldb/
(In reply to comment #3) Thanks for the comments. I think I will go that > Or you can create one shell script that does all the above and add > "ExecStartPre=-/path/to/script" to the [Service] section ( above the ExecStart= > line ) in the monotone.service. route. > Pay attention to the "-" before the / in the ExecStartPre= line if you skip it > the service will fail to start if the relevant script does not exit cleanly. which might on the other hand desired, no? If creation or migration of the database is not possible, the service cannot (and thus should not try to) start.
(In reply to comment #5) > (In reply to comment #3) > > Pay attention to the "-" before the / in the ExecStartPre= line if you skip it > > the service will fail to start if the relevant script does not exit cleanly. > > which might on the other hand desired, no? If creation or migration of the > database is not possible, the service cannot (and thus should not try to) > start. Yup But for example how are you going to handled the keygen part? surely you dont want to create keys each time the service is started and if you skip the "-" then the service would fail to start encase the keys exist ( same thing applies for the migration/upgrade) ... You can have three separated scripts in three separated ExecStartPre= lines which should better point out to admins what failed when they run systemctl status <service> and which would allow you to use "-" where applicable. Anyway you might want to look at how Tom solved similar problem for postgresql and mysql if I can recall correctly he simply stopped doing all this stuff in the daemon startup and pointed users to use script or run the commands by hand...
Ping what's the current status on this?
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle. Changing version to '19'. (As we did not run this process for some time, it could affect also pre-Fedora 19 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19
Given that I have left the project and a new individual may or may not continue with systemd integration in the project by submitting new feature following whatever demands FPC and FESCo might have and thus new units in the process I'm closing this and all remaining bugs I had submitted for this particular feature as WONTFIX
Fixed in rawhide: monotone-1.1-14.fc24 uses systemd instead of sysv init.