Unix Technical Forum

cron adduser

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 ...


Go Back   Unix Technical Forum > Unix Operating Systems > Debian Linux > Debian Linux support

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-19-2008, 08:40 AM
=?ISO-8859-1?Q?S=E9verin_Richard?=
 
Posts: n/a
Default cron adduser

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-19-2008, 08:40 AM
Fredderic
 
Posts: n/a
Default Re: cron adduser

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-19-2008, 08:40 AM
sk8r-365
 
Posts: n/a
Default Re: cron adduser

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/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-19-2008, 08:40 AM
=?ISO-8859-1?Q?S=E9verin_Richard?=
 
Posts: n/a
Default Re: cron adduser

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:56 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com