Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue and fix for failed systemd startup at boot. #70

Open
daxm opened this issue Mar 14, 2022 · 6 comments
Open

Issue and fix for failed systemd startup at boot. #70

daxm opened this issue Mar 14, 2022 · 6 comments

Comments

@daxm
Copy link

daxm commented Mar 14, 2022

I encountered an issue with the systemd service failing to start and then failing to restart too fast. It appears that systemd, by default, attempts 5 times to restart and then quits. After the following changes I was able to get iodined.service to start up. (A little digging showed that my server needed 7 failures... just over the 5 that systemd permits by default.)

Here is the Unit file I got to work:

[Unit]
Description=A daemon for tunneling traffic over DNS queries
After=local-fs.target network.target systemd-tmpfiles-setup.service
Documentation=man:iodined(8)

[Service]
EnvironmentFile=/etc/default/iodine
ExecStart=/usr/sbin/iodined -f -u iodine -t /var/run/iodine $IODINED_ARGS -P ${IODINED_PASSWORD}
StartLimitIntervalSec=120
StartLimitBurst=120
Restart=on-failure
Type=simple

[Install]
WantedBy=multi-user.target

The only real difference is the StartLimit* lines. I think the only one that matters is the StartLimitBurst one but I've left both in there since it works consistently.

If it matters, I'm in a VM of Ubuntu 20.04 Desktop (gnome) with no modifications (basically a bare bones Ubuntu desktop install).

@yarrick
Copy link
Owner

yarrick commented Mar 15, 2022

It sounds like it is trying to start too early. Can you make the service depend on some standardized network target instead?

@daxm
Copy link
Author

daxm commented Mar 15, 2022

The unit file I show is the one "installed" with installing iodine. I just added the StartLimit* lines. Yes, I could modify it for myself but I'm offering this intel to help fix others issues. :-)

@yarrick
Copy link
Owner

yarrick commented Mar 15, 2022

Sorry, let me clarify. I am for updating the unit file, but would prefer another strategy. As I understand it systemd has some standard unit for network activation, and by saying iodined should start after that is done it would also work for your case? It seems more stable than prolonging the crash-restart loop (other environments might need longer timeouts than you).

@dmitrmax
Copy link

@yarrick seems that it is done already
After=local-fs.target **network.target** systemd-tmpfiles-setup.service

@dmitrmax
Copy link

@daxm can you provide any logs with failing attempts?

@equwal
Copy link

equwal commented Jun 3, 2023

/lib/systemd/system/iodine.service

[Unit]
Description=iodine DNS queiries as internet tunnel
After=network.target

[Service]
Type=oneshot
ExecStart=/usr/local/sbin/iodined -f -c 10.0.0.1 <domain>.com
[Install]
WantedBy=multi-user.target

Try this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants