Is there a way I can have a continuously running, background process that can be controlled by me (a regular, non-root user)?All I need to be able to do is start, stop and restart the process. Monitoring by PID and sending SIGHUP or SIGINT for termination is fine. I'm okay with using a complicated bash script, it doesn't have to be something system-wide. Just for me.I also really need it to not stop when I log off from ssh.Is there a way I can do this in RHEL 6.4?
Is there a mechanism to run a service by a non-root user?
rhel;not root user;daemon
screen or tmuxSure you can start processes and have then run continuously by making use of a terminal multiplexer such as screen or tmux. Processes can continue to persist in a screen or tmux session, and you can connect/disconnect to either (screen or tmux) as needed.backgroundingYou can run any process you like and then background it and then disconnect it from your current terminal using the command disown.$ disown -aAdditionally if you just want to start a process up and not have to background it and disown it you can use the command nohup.$ nohup myexec &When you exit the shell, myexec will continue to be running.ExampleStart a fake process.$ sleep 12345 &[1] 24339$Make sure we can see it:$ pgrep -f sleep 1234524339But it's still connected to our terminal:$ jobs[1]+  Running                 sleep 12345 &So let's disown it:$ disown -a$ jobs$See it's still running:$ pgrep -f sleep 1234524339Now let's log out, and log back in. See it's still there:$ pgrep -f sleep 1234524339You can kill this process any time using standard means:$ pkill -HUP -f sleep 12345$ pgrep -f sleep 12345$ The above will send the signal HUP to a process name matching the pattern sleep 12345. Double checking shows that it's now gone.