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 systemd service template for pypiserver #137

Closed
ssbarnea opened this issue May 9, 2016 · 3 comments
Closed

provide systemd service template for pypiserver #137

ssbarnea opened this issue May 9, 2016 · 3 comments
Assignees
Labels
Milestone

Comments

@ssbarnea
Copy link

ssbarnea commented May 9, 2016

Any daemon is supposed to run as a service, thus pypi-server needs a systemd template in order to be used as a proper services on Debian distributions (including Ubuntu).

If nobody has an already made template I will create one and contribute it.

Once this is installed people should be able to contron th pypi-server using commands line

service pypi-server start
service pypi-server stop
systemctl enable pypi-server
systemctl disable pypi-server

More information about systemd can be found at https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units

@ssbarnea
Copy link
Author

ssbarnea commented May 9, 2016

# /lib/systemd/system/pypi-server.service
[Unit]
Description=pypi-server
After=network.target

[Service]
Type=simple
# systemd requires absolute path here too.
PIDFile=/var/run/pypi-server.pid
User=www-data
Group=www-data

ExecStart=/usr/local/bin/pypi-server -p 8080 -vvv -u --disable-fallback --authenticate update,download --log-file /var/log/pypi-server.log --passwords /etc/nginx/.htpasswd /var/www/pypi
ExecStop=/bin/kill -TERM $MAINPID
ExecReload=/bin/kill -HUP $MAINPID
Restart=always

WorkingDirectory=/var/www/pypi

TimeoutStartSec=3
RestartSec=5

[Install]
WantedBy=multi-user.target

@mplanchard
Copy link
Contributor

I agree. We could also use some documentation on how to manage its startup with supervisor, for example. I'll use your configuration script for systemd and include that information in the documentation.

@mplanchard mplanchard added this to the Next 1.2.x Release milestone May 11, 2016
@mplanchard mplanchard self-assigned this May 11, 2016
ankostis added a commit to ankostis/pypiserver that referenced this issue Jun 17, 2016
+ pypiserver#133: Mention `pypi-uploader` project for copying pkgs from PyPi.
+ pypiserver#137: Provide sample `systemd` unit-file
@mplanchard
Copy link
Contributor

See #146

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

No branches or pull requests

2 participants