فهرست منبع

Better service standup opts

Andy Baugh 4 سال پیش
والد
کامیت
e14a0f41f9
3فایلهای تغییر یافته به همراه8 افزوده شده و 1 حذف شده
  1. 1 0
      Makefile
  2. 6 0
      Readme.md
  3. 1 1
      service-files/systemd.unit

+ 1 - 0
Makefile

@@ -16,6 +16,7 @@ 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
+	sed -ie 's#__PORT__#$(PORT)#g' ~/.config/systemd/user/tCMS.service
 	systemctl --user daemon-reload
 	systemctl --user enable tCMS
 	systemctl --user start tCMS

+ 6 - 0
Readme.md

@@ -6,9 +6,15 @@ A flexible perl CMS which supports multiple data models and content types
 Deployment is currently:
 * make depend
 * make install
+
+Then:
 * Set up proxy rule in your webserver
 * open tmux or screen
 * `starman -p $PORT www/server.psgi`
+OR (if you want tCMS as a systemd service for the current user):
+* PORT=$PORT make install-service
+
+$PORT being whatever port you want it to sit on.
 
 TODO: Make the makefile not rewrite itself when running make! Reset for now after run.
 

+ 1 - 1
service-files/systemd.unit

@@ -5,5 +5,5 @@ Description=tCMS
 WantedBy=default.target
 
 [Service]
-ExecStart=starman __REPLACEME__/www/server.psgi
+ExecStart=starman -p __PORT__ __REPLACEME__/www/server.psgi
 WorkingDirectory= __REPLACEME__/