Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. What is start-stop-daemon in linux scripting? Ask Question. Asked 8 years, 6 months ago. Active 2 years, 11 months ago. Viewed 75k times. What is start-stop-daemon and how should it be used? Improve this question. Saurabh Rajeev Das Rajeev Das 1, 4 4 gold badges 17 17 silver badges 21 21 bronze badges. Add a comment. Active Oldest Votes. Then, you do one of two things: start-stop-daemon -S [other arguments] something start something , if something wasn't already running.
If something wasn't running, do nothing. What does it mean? The process-name is usually the process filename, but it could have been changed by the process itself. Note: on most systems this information is retrieved from the process comm name from the kernel, which tends to have a relatively short length limit assuming more than 15 characters is non-portable. Note: using this matching option alone will cause all processes matching the user to be acted on.
Generic options -g , --group group gid Change to group or gid when starting the process. It will check repeatedly whether any matching processes are running, until none are. If the processes do not exit it will then take further action as determined by the schedule. If the end of the schedule is reached and forever is not specified, then start-stop-daemon exits with error status 2. If a schedule is specified, then any signal specified with --signal is ignored.
If not specified, defaults to the argument given to --exec. You can also specify a group by appending a : , then the group or gid in the same way as you would for the chown 1 command user : group.
If a user is specified without a group, the primary GID for that user is used. When using this option you must realize that the primary and supplemental groups are set as well, even if the --group option is not specified. The --group option is only for groups that the user isn't normally a member of like adding per process group membership for generic users like nobody. Please note that the pidfile is also written after the chroot. This is done after the chroot if the -r --chroot option is set.
When not specified, start-stop-daemon will chdir to the root directory before starting the process. This option will force start-stop-daemon to fork before starting the process, and force it into the background. Generic options -g , --group group gid Change to group or gid when starting the process. It will check repeatedly whether any matching processes are running, until none are. If the processes do not exit it will then take further action as determined by the schedule.
If the end of the schedule is reached and forever is not specified, then start-stop-daemon exits with error status 2. If a schedule is specified, then any signal specified with --signal is ignored. If not specified, defaults to the argument given to --exec. You can also specify a group by appending a : , then the group or gid in the same way as you would for the chown 1 command user : group. If a user is specified without a group, the primary GID for that user is used.
When using this option you must realize that the primary and supplemental groups are set as well, even if the --group option is not specified. The --group option is only for groups that the user isn't normally a member of like adding per process group membership for generic users like nobody. Please note that the pidfile is also written after the chroot. This is done after the chroot if the -r --chroot option is set. When not specified, start-stop-daemon will chdir to the root directory before starting the process.
This option will force start-stop-daemon to fork before starting the process, and force it into the background. Warning: start-stop-daemon cannot check the exit status if the process fails to execute for any reason. This is a last resort, and is only meant for programs that either make no sense forking on their own, or where it's not feasible to add the code for them to do this themselves. This will reset the current timeout to the specified value.
Do the same and print the user- friendly string for the errno value. When the timeout is reached, start-stop-daemon will exit with an error code, and no readiness notification will be awaited.
0コメント