소스 검색

Merge pull request #148 from troglodyne/systemd_service_files

Cruise Control for Cool
George S. Baugh 5 년 전
부모
커밋
9c8bd4e952
2개의 변경된 파일19개의 추가작업 그리고 0개의 파일을 삭제
  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__/