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

Provide a systemd .service file? #36

Closed
jmhickman opened this issue Mar 26, 2018 · 5 comments
Closed

Provide a systemd .service file? #36

jmhickman opened this issue Mar 26, 2018 · 5 comments

Comments

@jmhickman
Copy link
Contributor

It would be great if the software provided a Systemd .service unitfile. Wouldn't have to be installed by default, but just having it tucked away in lib/ or something where someone could edit the relevant paths and get that up and running. Thanks.

@noirscape
Copy link

noirscape commented Mar 26, 2018 via email

@Difegue
Copy link
Owner

Difegue commented Mar 26, 2018

The above is what I've done on my personal install. (Although I had to upgrade to debian stretch to get docker's restart=always working properly)

I wouldn't mind including a systemd service file, but I'm an old fuck who's still on sysvinit, so I don't have anything to test it properly on.
PRs welcome!

Mapping the current LRR npm commands to a service lifecycle shouldn't be too hard.

@jmhickman
Copy link
Contributor Author

That's cool about docker, but I'm hosting LANraragi in a LXC container that has it's own init.

I'll see if I can't find something that seems applicable, and then try it out myself. If it works, I'll submit it myself. But if someone already knows what to write, please feel free to put in a PR.

@jmhickman
Copy link
Contributor Author

So I've written up a file, and I'm just letting it do its thing until I'm sure that I haven't set anything on fire by using it.

If anyone wants to try it out:

[Unit]
Description=LANraragi web application
After=network.target,redis.service # not sure if just redis.service would work or not

[Service]
Type=simple
WorkingDirectory=your_install_path
ExecStart=/usr/bin/npm start
#Restart=on-failure

[Install]
WantedBy=multi-user.target

I'm sure modifications could be made, but so far this is working.

@Difegue
Copy link
Owner

Difegue commented Jun 6, 2018

Since there's been no additional problems reported, I'll be folding this example into 0.5.3 as a "in case you want this" thing.

Thanks again!

@Difegue Difegue closed this as completed Jun 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants