Skip to content

Commit

Permalink
Systemd service file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferry Boender committed Apr 30, 2017
1 parent adf3f62 commit e034077
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ release_deb: release_src doc

cp contrib/scriptform.init.d_debian rel_deb/usr/share/doc/$(PROG)
cp contrib/scriptform.init.d_redhat rel_deb/usr/share/doc/$(PROG)
cp contrib/scriptform.service rel_deb/usr/share/doc/$(PROG)
cp -ar contrib/debian/DEBIAN rel_deb/

# Bump version numbers
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,18 @@ For **RedHat / Centos** systems:
Then edit `/etc/init.d/scriptform` and change the `FORM_CONFIG` setting to
point at the form configuration JSON file you'd like to use.

There's also a **Systemd** unit file, which should work on most systems that
run on systemd:

sudo cp /usr/share/doc/scriptform/scriptform.service /etc/systemd/system/

Then edit `/etc/systemd/system/scriptform.service` and make change the
`FORM_CONFIG` environment variable to point at the form configuration JSON
file you'd like to use.




## Usage

Usage:
Expand Down
14 changes: 14 additions & 0 deletions contrib/scriptform.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Scriptform
After=network.target

[Service]
Environment=FORM_CONFIG=/home/fboender/Projects/fboender/scriptform/examples/megacorp_acc/megacorp_acc.json
Environment=LOG_FILE=/var/log/scriptform.log
Environment=PORT=8081
ExecStart=/usr/bin/scriptform --pid-file=/var/run/scriptform.pid --port=${PORT} --log-file=${LOG_FILE} ${FORM_CONFIG}
Type=forking
PIDFile=/var/run/scriptform.pid

[Install]
WantedBy=default.target

0 comments on commit e034077

Please sign in to comment.