Skip to content

Commit

Permalink
Add packaging support for Systemd (for 16.04)
Browse files Browse the repository at this point in the history
Various other small packaging changes/improvements

Rename nginx to NGINX:
https://forum.nginx.org/read.php?2,255874,255879
  • Loading branch information
lukeyeager committed Sep 28, 2016
1 parent d9675db commit 599d015
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 24 deletions.
6 changes: 3 additions & 3 deletions packaging/deb/extras/custom_http_errors/413.shtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<html>
<title>File too large</title>
<title>Failed to upload file</title>
<body>
<h1>Error - File upload too large</h1>
<h1>Error: File upload too large</h1>
<p>
You attempted to upload a file that exceeded the limit allowed by the
NGINX reverse proxy server.
Expand All @@ -13,7 +13,7 @@ You can try uploading your file directly to the DIGITS server running at
</p>
<p>
You can also try increasing the value of the client_max_body_size setting
in /etc/nginx/sites-available/digits.site.
in /etc/nginx/sites-available/digits.nginx-site.
</p>
</body>
</html>
37 changes: 30 additions & 7 deletions packaging/deb/extras/custom_http_errors/502.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,41 @@
<html>
<title>Failed to connect to DIGITS</title>
<body>
<h1>Error: Unable to connect to NVIDIA DIGITS</h1>
<h1>Error: Unable to connect to DIGITS</h1>

<h3>Restart the server</h3>
<p>
To fix this problem, try stopping and restarting the DIGITS server by running
the following two commands:
On Ubuntu 14.04, use this command to restart the server:
</p>
<pre>
sudo stop digits
sudo start digits
sudo service digits restart
</pre>
<p>
If you are still encountering problems after attempting to restart the DIGITS
server, check /var/log/digits/digits.log for errors.
On Ubuntu 16.04, use this command to restart the server:
</p>
<pre>
sudo systemctl restart digits
</pre>

<h3>Check the logs for errors</h3>
<p>
If you are still encountering problems after restarting, check the logs for errors.
</p>
<pre>
cat /var/log/digits/digits.log
</pre>
</p>
<p>
For additional messsages on Ubuntu 14.04:
</p>
<pre>
cat /var/log/upstart/digits.log
</pre>
<p>
For additional messages on Ubuntu 16.04:
</p>
<pre>
journalctl -u digits.service
</pre>
</body>
</html>
2 changes: 1 addition & 1 deletion packaging/deb/extras/digits.nginx-site
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DIGITS nginx site
# DIGITS NGINX site

server {
listen 80; #AUTOCONFIG port (DO NOT DELETE THIS LINE)
Expand Down
2 changes: 1 addition & 1 deletion packaging/deb/templates/control
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Maintainer: #USERNAME# <#EMAIL#>
Homepage: https://developer.nvidia.com/digits
Vcs-Browser: https://github.com/NVIDIA/DIGITS
Priority: optional
Build-Depends: debhelper (>= 9), dh-python, python-all, python-setuptools, debconf
Build-Depends: debhelper (>= 9), dh-python, dh-systemd, python-all, python-setuptools, debconf
Standards-Version: #POLICY#

Package: digits
Expand Down
4 changes: 2 additions & 2 deletions packaging/deb/templates/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ Upstream-Name: #PACKAGE#
Source: https://github.com/NVIDIA/DIGITS

Files: *
Copyright: #YEAR# #USERNAME# <#EMAIL#>
Copyright: #YEAR# NVIDIA CORPORATION
License: BSD-3-Clause

Files: debian/*
Copyright: #YEAR# #USERNAME# <#EMAIL#>
Copyright: #YEAR# NVIDIA CORPORATION
License: BSD-3-Clause

License: BSD-3-Clause
Expand Down
2 changes: 0 additions & 2 deletions packaging/deb/templates/digits.default

This file was deleted.

4 changes: 2 additions & 2 deletions packaging/deb/templates/digits.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ case "$1" in
# Update permissions on new directories
chown www-data /var/lib/digits/jobs /var/log/digits

# Disable default nginx site
# Disable default NGINX site
NGINX_NEEDS_RELOAD=false
DEFAULT_SITE=/etc/nginx/sites-enabled/default
if [ -L "$DEFAULT_SITE" ]
Expand All @@ -26,7 +26,7 @@ case "$1" in

# Enable nginx site
SITE_FILE=/etc/nginx/sites-available/digits.nginx-site
SITE_LINK=/etc/nginx/sites-enabled/digits.site
SITE_LINK=/etc/nginx/sites-enabled/digits.nginx-site
if [ "$PORT" != "-1" ]
then
sed "s/.*AUTOCONFIG port.*/ listen ${PORT}; #AUTOCONFIG port (DO NOT DELETE THIS LINE)/" $SITE_FILE -i
Expand Down
4 changes: 2 additions & 2 deletions packaging/deb/templates/digits.prerm
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ set -e

case "$1" in
remove)
# Disable nginx site
SITE_LINK=/etc/nginx/sites-enabled/digits.site
# Disable NGINX site
SITE_LINK=/etc/nginx/sites-enabled/digits-nginx.site
if [ -L "$SITE_LINK" ]
then
rm -f $SITE_LINK
Expand Down
15 changes: 15 additions & 0 deletions packaging/deb/templates/digits.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# DIGITS systemd service
[Unit]
Description=DIGITS server
After=local-fs.target network.target

[Service]
User=www-data
Environment="DIGITS_JOBS_DIR=/var/lib/digits/jobs"
Environment="DIGITS_LOGFILE_FILENAME=/var/log/digits/digits.log"
ExecStart=/usr/bin/python -m digits -p 34448
Restart=on-failure
ExecStop=/bin/kill -INT $MAINPID

[Install]
WantedBy=multi-user.target
6 changes: 3 additions & 3 deletions packaging/deb/templates/digits.templates
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Template: digits/port
Type: string
Default: 80
Description: DIGITS front-end port for nginx reverse proxy (0-65535):
Description: DIGITS front-end port for NGINX reverse proxy (0-65535):
The DIGITS backend server runs on port 34448 (DIGIT), but this package also
configures nginx to function as a reverse proxy for DIGITS.
configures NGINX to function as a reverse proxy for DIGITS.
.
If you don't want to use nginx as a reverse proxy, choose "-1" and the nginx
If you don't want to use NGINX as a reverse proxy, choose "-1" and the NGINX
site will not be installed.

Template: digits/port-invalid
Expand Down
2 changes: 1 addition & 1 deletion packaging/deb/templates/rules
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/make -f

%:
dh $@ --parallel --with=python2 --buildsystem=pybuild
dh $@ --parallel --with=python2,systemd --buildsystem=pybuild

0 comments on commit 599d015

Please sign in to comment.