You are not logged in.
[EDIT 2013-02-02] Seems I wasn't supposed to have my interactive scripts work with systemd services - Services cannot read from stdin, as this will be connected to /dev/null. That means interactive init scripts are not supported... Must have been a fluke that I had them working at all. Oh well, it was fun while it lasted.
The service shown below worked flawlessly until about a week ago but it still seems to get started on boot.
systemd[1]: Starting /etc/rc.local Compatibility...
...but it seems stuck in "activating" mode...
KairiTech-TO% systemctl
UNIT LOAD ACTIVE SUB JOB DESCRIPTION
.
.
rc-local.service loaded activating start start /etc/rc.local Compatibility
.
.
I've removed several "ExecStart=..." lines for troubleshooting but even though the service is started the logger command (or anything else I include) does not get executed.
Any Ideas on what may have changed?
[Unit]
Description=/etc/rc.local Compatibility
After=network.target
[Service]
Type=oneshot
TimeoutSec=0
StandardInput=tty
RemainAfterExit=yes
ExecStart=-/usr/bin/logger "Kairi: Initiating startup..."
ExecStart=-/usr/bin/logger "Kairi: Startup done."
[Install]
WantedBy=multi-user.target
Last edited by KairiTech (2013-02-02 12:52:10)
Offline
Support for rc.local and similar setups was removed. Are you just trying to write a custom service file?
Last edited by Scimmia (2013-01-27 19:34:51)
Offline
I am. I had it working until very recently but I can't seem to figure out what changed recently if anything.
Offline
Why use the rc.local unit as a template? It's handled differently than other units. Just follow the info here: https://wiki.archlinux.org/index.php/Sy … vice_files and see see examples here: https://wiki.archlinux.org/index.php/Systemd/Services
Offline
I've done that already. See first post for what I created.
Offline
I have the same problem, since about a week ago.
My unit file:
[Unit]
Description=/etc/rc.local Compatibility
After=network.target
[Service]
Type=oneshot
ExecStart=-/etc/rc.local
TimeoutSec=0
StandardInput=tty
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Offline
I looked at the service file included in the initscript package and it seems you now need to include the "ConditionFileIsExecutable=..." line in the unit's description section which I did. Even so, when I try to run three of my scripts in succession they don't work exactly the same way as if I run the /etc/rc.local script in a terminal as root. Still working on that part of the problem so I'm not quite ready to mark this as solved yet.
[Unit]
Description=/etc/rc.local.shutdown Compatibility
ConditionFileIsExecutable=/etc/rc.local
DefaultDependencies=no
After=rc-local.service basic.target
Before=shutdown.target
Offline
Simplest solution? DITCH INITSCRIPTS!!!
Offline
I absolutely did that once I finished looking at them as an example but I want my startup scripts.
So am I like the only Arch use who wants system-wide custom setup scripts run at boot?
Offline
KairiTech, to start with, use a custom service file to run a custom scripts, not the rc.local service file to run rc.local.
Beyond that, is there anything in your script that can't be done in a .service file?
Offline
I am using the rc-local.service included in the initscripts package for instructional purposes only and created my own service and even gave it a different name.
I guess my question is, has anyone been able to confirm that ANY interactive script that can run in a termainl can be run with exactly the same results by a systemd service?
My scripts' complexity should be besides the point (and they are complex) but they used to run up to a few weeks ago from the service I created a while back but something (not my scripts) changed recently and now they don't run without the "ConditionFileIsExecutable=..." addition and even with that added they act a bit strange and not exactly as they do in a terminal.
Last edited by KairiTech (2013-02-01 22:35:30)
Offline
I can confirm a change in behaviour. Not all my commands in my rc.local run through now. I found out that putting a sleep > 5 at the beginning stops already everything what is coming after.
Offline
Have you looked for similar files in systemd's own service files? That is, for interactive cases?
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
ConditionFileIsExecutable doesn't help me.
'systemctl start rc-local' just hangs forever.
Offline
ConditionFileIsExecutable doesn't help me.
'systemctl start rc-local' just hangs forever.
Could this have something to do with this warning on the wiki page for systemd?
Warning: If you install both of systemd (197-4 or later) and initscripts, and /etc/rc.local is existent, boot process will never finish (Because getty@tty1.service has not waited rc-local.service from systemd 197-4, getty cannot start). So remove or rename /etc/rc.local first.
Personnaly I don’t understand what it means…
(And my problem since yesterday’s update is that launching background processes from rc.local doesn’t work anymore…)
Offline