File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,47 @@ the OpenSSH is never used nor needed — you can even uninstall it if you want t
119119Incidentally, there's no risk of accidentally sharing a shell because there's no
120120default behavior that does that on Wish.
121121
122+ ## Running with SystemD
123+
124+ If you want to run a Wish app with ` systemd ` , you can create an unit like so:
125+
126+ ` /etc/systemd/system/myapp.service ` :
127+ ``` service
128+ [Unit]
129+ Description=My App
130+ After=network.target
131+
132+ [Service]
133+ Type=simple
134+ User=myapp
135+ Group=myapp
136+ WorkingDirectory=/home/myapp/
137+ ExecStart=/usr/bin/myapp
138+ Restart=on-failure
139+
140+ [Install]
141+ WantedBy=multi-user.target
142+ ```
143+
144+ You can tune the values bellow, and once you're happy with them, you can run:
145+
146+ ``` bash
147+ # need to run this every time you change the unit file
148+ sudo systemctl daemon-reload
149+
150+ # start/restart/stop/etc:
151+ sudo systemctl start myapp
152+ ```
153+
154+ If you use a new user for each app (which is good), you'll need to create them
155+ first:
156+
157+ ``` bash
158+ useradd --system --user-group --create-home myapp
159+ ```
160+
161+ That should do it.
162+
122163###
123164
124165## Feedback
You can’t perform that action at this time.
0 commit comments