Skip to main content
fix a typo
Source Link
Thomas Dickey
  • 79.2k
  • 9
  • 189
  • 289

As you see in the manpage:

--session-command=command Same as -c , but do not create a new session (discouraged).

So the default invocation requires to cretecreate a new process, because a new session need a new PID.

Additionally the return code depends on exit status, or on the signal that killed the process. This last point also requires a process monitoring the status of the child process.

I think this is due by design. Unlike susu, IMO, runuserrunuser is made to be used in scripts (so never ask for password, handle error status better, and also separate signals handling (new session) from caller.

As you see in the manpage:

--session-command=command Same as -c , but do not create a new session (discouraged).

So the default invocation requires to crete a new process, because a new session need a new PID.

Additionally the return code depends on exit status, or on the signal that killed the process. This last point also requires a process monitoring the status of the child process.

I think this is due by design. Unlike su, IMO, runuser is made to be used in scripts (so never ask for password, handle error status better, and also separate signals handling (new session) from caller.

As you see in the manpage:

--session-command=command Same as -c , but do not create a new session (discouraged).

So the default invocation requires to create a new process, because a new session need a new PID.

Additionally the return code depends on exit status, or on the signal that killed the process. This last point also requires a process monitoring the status of the child process.

I think this is due by design. Unlike su, IMO, runuser is made to be used in scripts (so never ask for password, handle error status better, and also separate signals handling (new session) from caller.

Source Link

As you see in the manpage:

--session-command=command Same as -c , but do not create a new session (discouraged).

So the default invocation requires to crete a new process, because a new session need a new PID.

Additionally the return code depends on exit status, or on the signal that killed the process. This last point also requires a process monitoring the status of the child process.

I think this is due by design. Unlike su, IMO, runuser is made to be used in scripts (so never ask for password, handle error status better, and also separate signals handling (new session) from caller.