Linux - How to start a service or process as user, Star process as user system startup

How to start a service or process as user

How to Start a service or process as user

You can start a process at the time of system start. If you to start a process or application during the system start then you will be executing the start up script from /etc/rc.local.

The commands or scripts added to /etc/rc.local will be executed after the execution of init scripts i.e. when the system is in the ready state.

The process invoked using /etc/rc.local will have the root ownership. Use the below command to start the service or process as a normal user and not as a root user.

  su <username> -c 'command-to-inovke-the-process'

Example :
  su math -c 'sh starttomcat.sh'

The above command will start the tomcat as users math.

The topic on Linux - How to start a service or process as user is posted by - Math

Hope you have enjoyed, Linux - How to start a service or process as userThanks for your time

Tech Bluff