You are not logged in.

#1 2013-01-27 15:36:25

KairiTech
Member
From: Toronto, Canada
Registered: 2011-06-04
Posts: 227

[Solved] systemd rc.local sevice suddenly stopped working

[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)


-=[ LIVE enabled UEFI with redundant syslinux pure systemd detached LUKS header partitionless encrypted GPT SSDx3 RAID0 because I can.  ]=-

Backward compatibility is for the masses. There's no dual-boot here...

Offline

#2 2013-01-27 19:03:49

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 4,783

Re: [Solved] systemd rc.local sevice suddenly stopped working

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

#3 2013-01-27 19:26:50

KairiTech
Member
From: Toronto, Canada
Registered: 2011-06-04
Posts: 227

Re: [Solved] systemd rc.local sevice suddenly stopped working

I am. I had it working until very recently but I can't seem to figure out what changed recently if anything.


-=[ LIVE enabled UEFI with redundant syslinux pure systemd detached LUKS header partitionless encrypted GPT SSDx3 RAID0 because I can.  ]=-

Backward compatibility is for the masses. There's no dual-boot here...

Offline

#4 2013-01-27 19:39:20

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 4,783

Re: [Solved] systemd rc.local sevice suddenly stopped working

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

#5 2013-01-27 19:44:43

KairiTech
Member
From: Toronto, Canada
Registered: 2011-06-04
Posts: 227

Re: [Solved] systemd rc.local sevice suddenly stopped working

I've done that already. See first post for what I created.


-=[ LIVE enabled UEFI with redundant syslinux pure systemd detached LUKS header partitionless encrypted GPT SSDx3 RAID0 because I can.  ]=-

Backward compatibility is for the masses. There's no dual-boot here...

Offline

#6 2013-01-31 16:45:41

kyak
Member
Registered: 2012-01-20
Posts: 12

Re: [Solved] systemd rc.local sevice suddenly stopped working

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

#7 2013-01-31 21:51:39

KairiTech
Member
From: Toronto, Canada
Registered: 2011-06-04
Posts: 227

Re: [Solved] systemd rc.local sevice suddenly stopped working

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

-=[ LIVE enabled UEFI with redundant syslinux pure systemd detached LUKS header partitionless encrypted GPT SSDx3 RAID0 because I can.  ]=-

Backward compatibility is for the masses. There's no dual-boot here...

Offline

#8 2013-02-01 04:04:05

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 4,783

Re: [Solved] systemd rc.local sevice suddenly stopped working

Simplest solution? DITCH INITSCRIPTS!!!

Offline

#9 2013-02-01 15:45:13

KairiTech
Member
From: Toronto, Canada
Registered: 2011-06-04
Posts: 227

Re: [Solved] systemd rc.local sevice suddenly stopped working

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?


-=[ LIVE enabled UEFI with redundant syslinux pure systemd detached LUKS header partitionless encrypted GPT SSDx3 RAID0 because I can.  ]=-

Backward compatibility is for the masses. There's no dual-boot here...

Offline

#10 2013-02-01 19:00:12

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 4,783

Re: [Solved] systemd rc.local sevice suddenly stopped working

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

#11 2013-02-01 22:32:46

KairiTech
Member
From: Toronto, Canada
Registered: 2011-06-04
Posts: 227

Re: [Solved] systemd rc.local sevice suddenly stopped working

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)


-=[ LIVE enabled UEFI with redundant syslinux pure systemd detached LUKS header partitionless encrypted GPT SSDx3 RAID0 because I can.  ]=-

Backward compatibility is for the masses. There's no dual-boot here...

Offline

#12 2013-02-02 01:51:30

kodiak
Member
Registered: 2012-04-26
Posts: 59

Re: [Solved] systemd rc.local sevice suddenly stopped working

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

#13 2013-02-02 01:53:41

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,661

Re: [Solved] systemd rc.local sevice suddenly stopped working

Have you looked for similar files in systemd's own service files? That is, for interactive cases?


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#14 2013-02-02 08:19:17

kyak
Member
Registered: 2012-01-20
Posts: 12

Re: [Solved] systemd rc.local sevice suddenly stopped working

ConditionFileIsExecutable doesn't help me.

'systemctl start rc-local' just hangs forever.

Offline

#15 2013-02-11 17:07:42

stqn
Member
Registered: 2010-03-19
Posts: 1,189
Website

Re: [Solved] systemd rc.local sevice suddenly stopped working

kyak wrote:

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

Board footer

Powered by FluxBB