[arch-general] systemd script at boot?
Hi, Can systemd run a bash script at/after boot without having to install initscripts-systemd for compatibility with rc.local? I assume initscripts-systemd will be depreciated eventually so wonder if there is a native way to do this, or if this is the workaround for now. Thanks, jsteel
You can create a service that runs your shell script at boot. I think it would be something like this: /etc/systemd/system/a-name-you-want.service [Unit] Description=a-name-you-want [Service] ExecStart=/path-to-your-script [Install] WantedBy=multi-user.target 2012/7/28 jsteel <mail@jsteel.org>
Hi,
Can systemd run a bash script at/after boot without having to install initscripts-systemd for compatibility with rc.local? I assume initscripts-systemd will be depreciated eventually so wonder if there is a native way to do this, or if this is the workaround for now.
Thanks,
jsteel
-- Leonardo Dagnino
On 29 July 2012 00:26, Leonardo Dagnino <leodag.sch@gmail.com> wrote:
You can create a service that runs your shell script at boot. I think it would be something like this:
/etc/systemd/system/a-name-you-want.service
[Unit] Description=a-name-you-want
[Service] ExecStart=/path-to-your-script
[Install] WantedBy=multi-user.target
Perfect, thanks! jsteel
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 07/28/2012 04:10 PM, jsteel wrote:
Can systemd run a bash script at/after boot without having to install initscripts-systemd for compatibility with rc.local? I assume initscripts-systemd will be depreciated eventually so wonder if there is a native way to do this, or if this is the workaround for now.
There *is* a service available that looks like it would execute rc.local. According to the Arch wiki, there is an initscripts-systemd package and and "/etc/rc.local and /etc/rc.local.shutdown can be run at startup and shutdown by enabling rc-local.service and rc-local-shutdown.service." The package is not recommended but it exists. - -- David Benfell benfell@parts-unknown.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJQFMS9AAoJELT202JKF+xpaxMP/iCqs6eH4GwXBbIPaGEda4yr uKCUDs5MI4HIqIOm0wi1uiKqpPuIunsxRTWXJrPpNjQiqZ//tBjntd5RnvakhMwm QSs6ugmf9CXgEmg5HuSI+HExioUUcMH2jwXLQSLlqbKL4NscWkZkrNkPP9WpYWgU yg+kTVmYUyApUT2agBWR9sgkCwY+fqGZntfSVsZM3pPJcqcFQpoMWo02hJ0V6wLb qfZe83b3OeN2R/sM8uB0FsORM9vpQHgyMuJHLT+MSodlBAb/IaLahFhPnxmjEGEG Dhnt+Vw5wsSZ16EFLl5CMb+AFXsmCfIL2iPZe6oqQrW9cJJUiP283TH1yzgVQuQJ ULskw+jrDzJYSyQsees7fwZWBPrgdQgezZFwGjpAHICKvBnbAP1GppxwQAnoF9w2 WgjNSfjCApZQmFXXm1bJ+lrvK7SBdPM14IfcySzIpSU1qexg/hHdj+rmKPsYB1sg 4PwJshP6tmAkPUc94DHXHxyPG1sZAjZYoYyOFEbHdn2uncHIHJHkUnq10pSlZwkB o1rxqYJa/hohjn+H4QPkxtp+UfIJFe4yUIKQjs3ol309pwi6qeIc9ySz0fm7/jxM DWVPzvoyR9hD4tTGbEJAHfaxCcPdCNdG5b+91z6dkY4gxAdfvF94EXCzSZwp+Uti ygEsQQr4aX2KeU4vt0v7 =XPdq -----END PGP SIGNATURE-----
On Sun, Jul 29, 2012 at 7:06 AM, David Benfell <benfell@parts-unknown.org> wrote:
There *is* a service available that looks like it would execute rc.local.
According to the Arch wiki, there is an initscripts-systemd package and and "/etc/rc.local and /etc/rc.local.shutdown can be run at startup and shutdown by enabling rc-local.service and rc-local-shutdown.service." The package is not recommended but it exists.
FWIW, in the next initscripts release all the systemd compatibility stuff was merged and enabled by default. That is, DAEMONS, MODULES in rc.conf and rc.local and rc.local.shutdown, will "just work" as before if initscripts is installed and you use systemd. -t
On Sun, Jul 29, 2012 at 6:10 AM, Tom Gundersen <teg@jklm.no> wrote:
On Sun, Jul 29, 2012 at 7:06 AM, David Benfell <benfell@parts-unknown.org> wrote:
There *is* a service available that looks like it would execute rc.local.
According to the Arch wiki, there is an initscripts-systemd package and and "/etc/rc.local and /etc/rc.local.shutdown can be run at startup and shutdown by enabling rc-local.service and rc-local-shutdown.service." The package is not recommended but it exists.
FWIW, in the next initscripts release all the systemd compatibility stuff was merged and enabled by default. That is, DAEMONS, MODULES in rc.conf and rc.local and rc.local.shutdown, will "just work" as before if initscripts is installed and you use systemd.
-t
Yes they do and, caveat at least for me on two machines, the integration works great. One more great big thanks. You saved me from being forced to learn iproute2 to set up my network. At least for a little while. Myra -- Life's fun when your sick and psychotic!
participants (5)
-
David Benfell
-
jsteel
-
Leonardo Dagnino
-
Myra Nelson
-
Tom Gundersen