specialized subdirectory

j.travis skynet at psinode.com
Wed Jul 7 19:50:26 UTC 2004


> have you considered simply writing a shell script to do this for you?
> e.g.
> (off the top of my head, so apologies for clumsiness)
> e.g /root/bin/users.sh
> # --begin--#
> #!/bin/bash
> for user in $*
> do
> useradd -d /home/share $user
> install -o $user -g (users primary group) -d /home/share/.$user-mail
> done
> # -- end
> 
> and call it with 
> users.sh user1 user2 user3 user4 (etc etc)
> 
> if you don't like the install command, you can always replace it with mkdir 
> and chown
> 
> I assume your setup means that all your users share the same primary group?

They do share the same primary group.  There is actually external software (a web based control panel) adding the users and I was hoping for something that could be triggered by the 'useradd' function (kind of like how /var/spool/mail/$USER gets created instantly).    I've combed over features in login.defs pretty well and it doesn't seem to have it.  Fortunately, the sendmail service gets restarted whenever a user is added so I can put the commands into the sendmail init script. Otherwise a shell script would have to come along every (hour?/minute?/some-time-interval)  to do the work.  

appreciate the tipoff for the 'install' command.  I will likely use that.   





More information about the redhat-list mailing list