[opensuse-factory] converting to systemd: appliance "firstboot" scripts
Hallo, as systemd is all the rage and I want to embrace change, I am updating some appliances and deprecating init scripts which have no issues. I am stuck though with firstboot scripts. Up until now, I ported some self-deleting firstboot.sh via tarball into the appliance, and images.sh contained essentially "copy to /etc/init.d, chmod". How would I build a custom firstboot (run only once) script with systemd-native "units"? -- Ralf Lang Linux Consultant / Developer Tel.: +49-170-6381563 Mail: lang@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
On Sun, 25 Jan 2015 14:20, Ralf Lang <lang@...> wrote:
Hallo,
as systemd is all the rage and I want to embrace change, I am updating some appliances and deprecating init scripts which have no issues.
I am stuck though with firstboot scripts.
Up until now, I ported some self-deleting firstboot.sh via tarball into the appliance, and images.sh contained essentially "copy to /etc/init.d, chmod".
How would I build a custom firstboot (run only once) script with systemd-native "units"?
For the 'new' systemd (218 AFAIK) have a look at systemd-run (1) it allows to program a systemd.timer (5) like the at command, but with a much broader timer spectrum, or comparable to crontab @boot line, e.g. --on-boot=, --on-startup=, and others timer variants. If your script makes sure to remove any existing system.timer after its own start, you have a run-once function for the next boot with the --on-boot= option. No idea what to do for older systemd versions, at least not that comfy. (AFAICS: generate unit/service file, enable, your script contains disable, remove of unit/service file) Version 218 should be in factory soon. Does anyone else have better ideas? Please share! References: (1) http://www.freedesktop.org/software/systemd/man/systemd-run.html (5) http://www.freedesktop.org/software/systemd/man/systemd.timer.html - Yamaban. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (2)
-
Ralf Lang
-
Yamaban