This is a discussion on cron adduser within the Debian Linux support forums, part of the Debian Linux category; --> hi, creating a .php script: <? exec( "useradd myuser" ); ?> called by cron as root, does not create ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| On Thu, 23 Aug 2007 16:35:20 +0200, Séverin Richard <severin.richard@free.fr> wrote: > creating a .php script: > <? exec( "useradd myuser" ); ?> > called by cron as root, does not create a user. Just a guess here... useradd doesn't want keyboard input, for example, for the users initial password, does it? Some programs, especially those that want passwords, will fail to run if they're not connected to a terminal. There's usually options to provide the necessary information more directly. Fredderic |
| |||
| Horton heard a Who named Séverin Richard saying: > hi, > > creating a .php script: > <? exec( "useradd myuser" ); ?> > > called by cron as root, does not create a user. > > > Can anybody tell me a way of search??? There may be some log entry stating the problem such as /var/log/daemon.log. Could try running it directly from a terminal and see if there's any message. Plus, and I'm not certain this is needed, but you could add your user to sudousers for that command with the NOPASSWD option. Like this (from my list): cmo ALL= NOPASSWD: /usr/sbin/fetchnews HTH, -- sk8r-365 http://goodbye-microsoft.com/ |
| ||||
| Fredderic wrote: > On Thu, 23 Aug 2007 16:35:20 +0200, > Séverin Richard <severin.richard@free.fr> wrote: > > >>creating a .php script: >><? exec( "useradd myuser" ); ?> >>called by cron as root, does not create a user. > > > Just a guess here... useradd doesn't want keyboard input, for example, > for the users initial password, does it? Some programs, especially > those that want passwords, will fail to run if they're not connected to > a terminal. There's usually options to provide the necessary > information more directly. > > > Fredderic I found the solution in another forum: exec( "/usr/sbin/useradd sdfsf"); works. The cron user does not have same $PATH than shell, and realpath have to be used. |