|
Home > Archive > Linux Debian support > August 2007 > cron adduser
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Séverin Richard 2007-08-23, 1:15 pm |
| 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???
thx for idears.
| |
| Fredderic 2007-08-23, 1:15 pm |
| On Thu, 23 Aug 2007 16:35:20 +0200,=20
S=E9verin 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
| |
| sk8r-365 2007-08-23, 7:14 pm |
| 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/
| |
| Séverin Richard 2007-08-24, 7:14 am |
| Fredderic wrote:
> On Thu, 23 Aug 2007 16:35:20 +0200,
> Séverin Richard <severin.richard@free.fr> wrote:
>
>
>
>
> 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.
|
|
|
|
|