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

[Feature] Add script for making systemd service #1583

Open
BenMcLean opened this issue Sep 8, 2018 · 3 comments
Open

[Feature] Add script for making systemd service #1583

BenMcLean opened this issue Sep 8, 2018 · 3 comments

Comments

@BenMcLean
Copy link

I would suggest that ZeroNet should come with a script to create a systemd service for ZeroNet, which would create and configure a service account for the purpose.

While trying to figure out how to do this myself, I read what somebody wrote on StackExchange:

However, service accounts are typically created and configured by the [package] manager upon installation of the service software. So, even as an administrator you should be rarely directly concerned with the creation of service accounts.

And that made me think, "Hey, ZeroNet should do that too."

@BenMcLean
Copy link
Author

BenMcLean commented Sep 8, 2018

Maybe this would actually be part of #241 ?

@BenMcLean
Copy link
Author

BenMcLean commented Sep 8, 2018

I figured out (with some help on IRC) what to do to get this working for my own case.

I happen to have my ZeroNet install living in /opt/ZeroBundle/ZeroNet

I made a file called zeronet.service

[Unit]
Description=ZeroNet: a decentralized web platform

[Service]
User=zeronet
Group=zeronet
WorkingDirectory=/opt/ZeroBundle/ZeroNet
ExecStart=/opt/ZeroBundle/Python/python /opt/ZeroBundle/ZeroNet/zeronet.py
Restart=on-failure

[Install]
WantedBy=default.target

I ran these commands (or something close)

sudo mv zeronet.service /etc/systemd/system/zeronet.service
sudo adduser zeronet
sudo chown zeronet:zeronet -R /opt/ZeroBundle
sudo systemctl enable zeronet.service
sudo systemctl start zeronet.service
sudo systemctl status zeronet.service

If the status indicates that you're running then you should be good.

I still think having this in a script that's distributed with the source code would be nice.

@satoshisfriendz
Copy link

I would suggest that ZeroNet should come with a script to create a systemd service for ZeroNet, which would create and configure a service account for the purpose.

While trying to figure out how to do this myself, I read what somebody wrote on StackExchange:

However, service accounts are typically created and configured by the [package] manager upon installation of the service software. So, even as an administrator you should be rarely directly concerned with the creation of service accounts.

And that made me think, "Hey, ZeroNet should do that too."

yes please

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

2 participants