Prechádzať zdrojové kódy

Cruise Control for Cool

Andy Baugh 5 rokov pred
rodič
commit
04a6bbd46c
2 zmenil súbory, kde vykonal 19 pridanie a 0 odobranie
  1. 10 0
      Makefile
  2. 9 0
      service-files/systemd.unit

+ 10 - 0
Makefile

@@ -5,6 +5,16 @@ install:
 	test -d data/files || mkdir data/files
 	rm pod2htmd.tmp; /bin/true
 
+.PHONY: install-service
+install-service:
+	mkdir -p ~/.config/systemd/user
+	cp service-files/systemd.unit ~/.config/systemd/user/tCMS.service
+	sed -ie 's#__REPLACEME__#$(shell pwd)#g' ~/.config/systemd/user/tCMS.service
+	systemctl --user daemon-reload
+	systemctl --user enable tCMS
+	systemctl --user start tCMS
+	loginctl enable-linger $(USER)
+
 .PHONY: test
 test: reset-dummy-data
 	prove

+ 9 - 0
service-files/systemd.unit

@@ -0,0 +1,9 @@
+[Unit]
+Description=tCMS
+
+[Install]
+WantedBy=default.target
+
+[Service]
+ExecStart=starman __REPLACEME__/www/server.psgi
+WorkingDirectory= __REPLACEME__/