You are not logged in.

#1 2014-09-10 05:33:30

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

systemd run-on-resume doesn't work

I am using connman which does not automatically populate resolve.conf with my desired dnses. So I turned to openresolv. The problem is that when I suspend and resume, /etc/resolve.conf gets reset and openresolve does not repopulate it again.

So I wrote a systemd service to run a script which should take care of it:

/etc/systemd/system/root-resume.service

[Unit]
Description=Local system resume actions
After=suspend.target

[Service]
Type=simple
ExecStart=/home/smith/.scripts/run_on_resume

[Install]
WantedBy=suspend.target

and the executable /home/smith/.scripts/run_on_resume
goes like that

sleep 30 ; resolvconf -u

If I run it manually, it works. But if I leave it to systemd – it doesn't.

To see if it runs with another command, I changed the content of "run_on_resume" to something like

sleep 30 ; touch /root/test

and it does work.

So I don't know what's the problem here...

Offline

Board footer

Powered by FluxBB