| ... | ... |
@@ -0,0 +1,33 @@ |
| 1 |
+# note that if you change this file you will need to run `systemctl daemon-reload` to get systemd to notice |
|
| 2 |
+[Unit] |
|
| 3 |
+Description=newsProxy as a system service take 2 |
|
| 4 |
+ |
|
| 5 |
+# After networking because we need that |
|
| 6 |
+After=network.target |
|
| 7 |
+ |
|
| 8 |
+[Service] |
|
| 9 |
+ |
|
| 10 |
+# Simple services don't do any forking / background nonsence |
|
| 11 |
+Type=simple |
|
| 12 |
+ |
|
| 13 |
+# User with which to run the service |
|
| 14 |
+User=ycawidro |
|
| 15 |
+ |
|
| 16 |
+# Any setup we need to do, specifying the shell because otherwise who knows what's up |
|
| 17 |
+#ExecStartPre=/bin/bash -c 'echo "hello world"' |
|
| 18 |
+ |
|
| 19 |
+# Set the working directory for the application |
|
| 20 |
+WorkingDirectory=/home/ycawidro/dev/newsProxy/ |
|
| 21 |
+ |
|
| 22 |
+# Command to run the application |
|
| 23 |
+#ExecStart=/usr/bin/python3 /home/ycawidro/dev/newsProxy/newsProxy |
|
| 24 |
+#ExecStart=/home/ycawidro/dev/newsProxy/newsProxy.sh |
|
| 25 |
+ExecStart=/bin/bash -c 'cd /home/ycawidro/dev/newsProxy/ && /usr/bin/python3 newsProxy.py' |
|
| 26 |
+ |
|
| 27 |
+# Restart policy, only on failure |
|
| 28 |
+Restart=on-failure |
|
| 29 |
+ |
|
| 30 |
+[Install] |
|
| 31 |
+# Start the service before we get to multi-user mode |
|
| 32 |
+WantedBy=multi-user.target |
|
| 33 |
+ |