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

Startup on boot #604

Open
IdotMaster1 opened this issue Feb 12, 2022 · 2 comments
Open

Startup on boot #604

IdotMaster1 opened this issue Feb 12, 2022 · 2 comments

Comments

@IdotMaster1
Copy link

Can I start the app on boot up automaticaly and if so how can I do it?

@trekkie1701c
Copy link

Add a systemd service.

[Unit]
Description=Discord IRC bridge
   
[Service]
Restart=on-failure
RestartSec=5s
User=user
Type=oneshot
ExecStart=/usr/local/bin/discord-irc --config /path/to/config

[Install]
WantedBy=multi-user.target

Then systemctl daemon-reload and systemctl enable discord-irc.

Note that it 'seems' to hang if you start/restart the service in that it doesn't drop you back to the shell. It's probably fixable but hasn't been something I really felt like looking into.

But in any case, this will not only start the bridge on boot, but if it crashes it'll automatically restart after 5 seconds. It won't, however, restart if the IRC connection or whatever drops - this only detects if the program itself exited.

@notvillers
Copy link

I would recommend to add After=network-online.target in the [Unit]

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

3 participants