
Ask HN: How do you manage startup processes/scripts on your servers? - nerva
So here&#x27;s my situation:<p>I have tmux running on my server, with ~5 windows, things like gunicorn, syncthing, custom scripts, etc. I really like to see whats being written to STDOUT and being able to kill the process&#x2F;restart it manually if necessary.<p>I open all these things manually right now, which if my server went down I&#x27;d be screwed hard until I noticed.<p>So is there some way to open tmux on startup with my processes so if something happens I don&#x27;t have to worry?<p>Or a better way to accomplish the same thing? How do do you guys&#x2F;ladies do this?
======
zbuf
Other posters are right, that services should really be started as services. I
have a piece of code which turns any basic foreground app into a daemon, with
logging and auto-restarts and it's great for node.js and similar. Time being
available I'd like to share this online sometime.

As for your specific situation, I do something similar but with screen not
tmux. A cron job with @reboot, and then a screenrc file starts each terminal
with the appropriate application. This is good for systems such as realtime
audio processors which have a live display, which straddle the line a little
between a daemon and interactive application.

------
DanielDent
Ugly hack: Use a cron job with "@reboot" as the time.

Better: Start your processes with systemd or another supervisor. You can
restart them manually, view their output using journalctl, ...

~~~
liw
This. Running services under screen or tmux is a kludge at best. For
unimportant or personal things, fine, but for any serious services, it's not
the way to go.

