PRIV_RESPAWN_AS

NAME
SYNOPSIS
DESCRIPTION
FILES
BUGS
AUTHOR
SEE ALSO

NAME

priv_respawn_as - spawn a new instance of the process as the specified user, possibly in a chroot jail.

SYNOPSIS

#include <privman.h>
int priv_respawn_as(void (*fnptr)(char * const *), char * const arg[], const char *user, const char *chroot);

DESCRIPTION

This method, priv_respawn_as causes the application to run again, falling out of priv_init with the original state intact. The current process will continue unaffected. The function pointed to by fnptr will be called with NULL-terminated the string array argument provided in arg before the application returns from priv_init, allowing you to change global state as required. The application will be running as user in the chroot jail chroot. You can pass NULL for the user and the chroot argmuments, in which case no chroot jail will be used, and the user will be the default unprivileged user.
Unlike priv_rerunas(3) both slave processes will be able to use a Privman server. See priv_rerunas(3) for more details and examples.
priv_respawn_as requires that allow_rerun be set to true in the application's configuration file. If the application needs to use either the user or chroot options, then runas_user and chroot will also have to be set properly in the application's configuration file. See privman_conf(3) for more detail.

FILES

${prefix}/etc/privman.d/appname
The application's configuration file. See privman_conf(5) for more details.

BUGS

This is not the simpliest primitive to understand. It might be nice if program execution could continue from the point of invocation rather than having to restart at priv_init().
It might be useful to be able to pass file descriptors.

AUTHOR

Network Associates. Send email to <privman@nailabs.com>

SEE ALSO

priv_bind(3) priv_daemon(3) priv_execve(3) priv_fopen(3) priv_fork(3) priv_wait4(3) priv_init(3) privman_conf(5) priv_open(3) priv_popen(3) priv_pam(3) privman(7)