]> pd.if.org Git - startuptools/blob - chids.c
set up mdev.seq in rc.sysinit
[startuptools] / chids.c
1 /*
2  * daemonize and exec
3  */
4
5 #include <stdlib.h>
6 #include <unistd.h>
7 #include <sys/types.h>
8 #include <pwd.h>
9
10 #include "exec.c"
11
12 int main(int ac, char *av[]) {
13         struct passwd *pw;
14
15         pw = getpwnam(av[1]);
16         if (!pw) {
17                 exit(EXIT_FAILURE);
18         }
19         
20         seteuid(pw->pw_uid);
21
22         do_exec(2, ac, av);
23
24         /* shouldn't get here... */
25         return EXIT_FAILURE;
26 }