Question: I run to run a command using the `su -s` command to start a process. Since I do not want the root user to own the process.

I try to do this by issuing the command

`su -s "$CATALINA_HOME/bin/catalina.sh run" tomcat`

which returns `su: /opt/apache-tomcat/bin/catalina.sh run: No such file or directory`

How can I run the `su -s` command along with arguments to not generate this error?

Answer: 
If you're running [`su`](http://man7.org/linux/man-pages/man1/su.1.html) as `root`, you can use `-s` to specify a different shell (running as `root` is necessary here since your `tomcat` user doesn't have a valid shell), and `-c` to specify the command to run:

```
su -s /bin/sh -c "$CATALINA_HOME/bin/catalina.sh run" tomcat

```

You might find [`start-stop-daemon`](http://man7.org/linux/man-pages/man8/start-stop-daemon.8.html) useful; it has a whole slew of options to specify the user and group to use, how to start the daemon etc. The [`tomcat8` initscript](https://salsa.debian.org/java-team/tomcat8/blob/master/debian/tomcat8.init) used in Debian might provide useful inspiration. Or you could look at writing a systemd unit or whatever is appropriate for your system's init.
The `-s` switch for `su` command is to change the shell of the specified user. The command you want to run must be preceded by `-c` switch. 

So the command you are looking for is something like this:

```
su -s /bin/bash -c "$CATALINA_HOME/bin/catalina.sh run" tomcat

```