Author Topic: Adding users gives error "root command set -e mkdir -p `dirname /home/****"  (Read 4435 times)

raggar

  • Zen Apprentice
  • *
  • Posts: 21
  • Karma: +1/-0
    • View Profile
After putting a config backup back (System -> import / export configuration) to Zentyal. Don't have al my users anymore. This is because they were not part of the config backup. (I know, I used an old backup...  :'( )

Nou I would like to add the users again, but when I add a new user I get:

Code: [Select]
root command set -e mkdir -p `dirname /home/martijn123` cp -dR --preserve=mode /etc/skel /home/martijn123 chown -R martijn123:__USERS__ /home/martijn123 chmod 0700 /home/martijn123 failed. Error output: chown: ongeldige gebruiker: ‘martijn123:__USERS__’ Command output: . Exit value: 1
I get this error also for adding new users (that did not previously exist). What is going wrong and how can I get the users back?

raggar

  • Zen Apprentice
  • *
  • Posts: 21
  • Karma: +1/-0
    • View Profile
After some searching around I found a few thing:
This bug has the same issue. http://trac.zentyal.org/ticket/3407

So I tried to restart the users module and after that I got an error that the webserver couldn't get started. But the sites I host are online and also sudo service apache2 status said Apache is running.

The error after restarting:
Code: [Select]
Some modules reported error when saving changes . More information on the logs in /var/log/zentyal/

The following modules failed while saving their changes, their state is unknown: webserver

From the /var/log/zentyal/zentyal.log
Code: [Select]
2013/02/01 17:50:09 ERROR> GlobalImpl.pm:643 EBox::GlobalImpl::__ANON__ - Failed to save changes in module webserver: root command /etc/init.d/apache2 restart failed.
Error output: apache2: Syntax error on line 237 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/sites-enabled/phpmyadmin: No such file or directory

Command output: Action 'configtest' failed.
 The Apache error log may have more information.
    ...fail!
.
Exit value: 1
2013/02/01 17:50:09 INFO> Base.pm:229 EBox::Module::Base::save - Restarting service for module: mail
2013/02/01 17:50:20 INFO> Base.pm:229 EBox::Module::Base::save - Restarting service for module: events
2013/02/01 17:50:20 INFO> Base.pm:229 EBox::Module::Base::save - Restarting service for module: logs
2013/02/01 17:50:20 ERROR> GlobalImpl.pm:700 EBox::GlobalImpl::saveAllModules - The following modules failed while saving their changes, their state is unknown: webserver
2013/02/01 17:51:08 ERROR> Sudo.pm:234 EBox::Sudo::_rootError - root command /etc/init.d/nscd reload failed.
Error output: Usage: /etc/init.d/nscd {start|stop|force-reload|restart|status}

Command output: .
Exit value: 1
2013/02/01 17:51:08 ERROR> Sudo.pm:234 EBox::Sudo::_rootError - root command set -e
mkdir -p `dirname /home/martijn-test12`
cp -dR --preserve=mode /etc/skel /home/martijn-test12
chown -R martijn-test12:__USERS__ /home/martijn-test12
chmod 0700 /home/martijn-test12 failed.
Error output: chown: ongeldige gebruiker: ‘martijn-test12:__USERS__’

Command output: .
Exit value: 1
2013/02/01 17:51:08 ERROR> User.pm:676 EBox::UsersAndGroups::User::__ANON__ - root command set -e
mkdir -p `dirname /home/martijn-test12`
cp -dR --preserve=mode /etc/skel /home/martijn-test12
chown -R martijn-test12:__USERS__ /home/martijn-test12
chmod 0700 /home/martijn-test12 failed.
Error output: chown: ongeldige gebruiker: ‘martijn-test12:__USERS__’

Command output: .
Exit value: 1
2013/02/01 17:51:49 INFO> GlobalImpl.pm:605 EBox::GlobalImpl::saveAllModules - Saving config and restarting services: firewall webserver
2013/02/01 17:51:49 INFO> Base.pm:229 EBox::Module::Base::save - Restarting service for module: firewall
2013/02/01 17:51:50 INFO> Base.pm:229 EBox::Module::Base::save - Restarting service for module: webserver
2013/02/01 17:51:51 ERROR> Sudo.pm:234 EBox::Sudo::_rootError - root command /etc/init.d/apache2 restart failed.
Error output: apache2: Syntax error on line 237 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/sites-enabled/phpmyadmin: No such file or directory

Command output: Action 'configtest' failed.
 The Apache error log may have more information.
    ...fail!
.
Exit value: 1
2013/02/01 17:51:51 ERROR> GlobalImpl.pm:643 EBox::GlobalImpl::__ANON__ - Failed to save changes in module webserver: root command /etc/init.d/apache2 restart failed.
Error output: apache2: Syntax error on line 237 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/sites-enabled/phpmyadmin: No such file or directory

Command output: Action 'configtest' failed.
 The Apache error log may have more information.
    ...fail!
.
Exit value: 1
2013/02/01 17:51:51 ERROR> GlobalImpl.pm:700 EBox::GlobalImpl::saveAllModules - The following modules failed while saving their changes, their state is unknown: webserver

Help is very much appreciated!

lhx1

  • Zen Apprentice
  • *
  • Posts: 7
  • Karma: +2/-0
    • View Profile
Hi
I too am getting the same error on creating new users.
Havent yet restared the system and so I will have to wait until after 5:00 tonight when I can have a play.

I've not restored any backups or anything and this is the first time that the problem has occurred.

The only thing I can think that I have done recently was to change the root password from the default to a personalised one.

Liam

raggar

  • Zen Apprentice
  • *
  • Posts: 21
  • Karma: +1/-0
    • View Profile
Hi Liam,

Thanks for your reply!

For me, the problem still exists. But I found a workaround by changing in /etc/zentyal/users.conf the line:
Code: [Select]
mk_home = yes  to
Code: [Select]
mk_home = no
After this I could add new users again. And because I don't need a home dir for new users so this solves my problem. But the actual problem still exist, Zentyal cannot make any new users with a home directory.

The only thing I changed (after setting back a backup) was changing the hostname. After that I restarted the server ofcourse.

Hope this helps  ;)

Javier Amor Garcia

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1225
  • Karma: +12/-0
    • View Profile
Hello,

I suspect that the group __USERS__ was not created. Can you run the following command?

Code: [Select]
sudo  slapcat | grep __USERS__

raggar

  • Zen Apprentice
  • *
  • Posts: 21
  • Karma: +1/-0
    • View Profile
Hi Javier,

Thanks for your help. This command gives me:

Code: [Select]
dn: cn=__USERS__,ou=Groups,dc=colo,dc=transip,dc=net
cn: __USERS__

raggar

  • Zen Apprentice
  • *
  • Posts: 21
  • Karma: +1/-0
    • View Profile
I just found something interessting. The following cronjob doesn't work:

Code: [Select]
cat ebox-mail
# Cron file for package zentyal-mail

# see if fetchmail daemon needs relaod each 10 minutes
1,11,21,31,41,51 * * * * root [ -x /usr/share/zentyal-mail/fetchmail-update ] && /usr/share/zentyal-mail/fetchmail-update
When excecuted as root: sudo  [ -x /usr/share/zentyal-mail/fetchmail-update ] && /usr/share/zentyal-mail/fetchmail-update
I get: Cannot change user to ebox. Are you root? at /usr/share/perl5/EBox.pm line 178.

Could it indeed be a users problem?

Javier Amor Garcia

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1225
  • Karma: +12/-0
    • View Profile
The
Code: [Select]
sudo  [ -x /usr/share/zentyal-mail/fetchmail-update ] && /usr/share/zentyal-mail/fetchmail-update thing has nothing to do with the problem. The message is triggered because the 'sudo' only applies to the first statement (before the '&&') so the second is executed as a normal user

Javier Amor Garcia

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1225
  • Karma: +12/-0
    • View Profile
Now, back to topic.

If the group exists, probably is a nsswitch problem.

Could you send me some of your configuration files in order to check this?.

I need:
- /etc/nsswitch.conf
- all the files under the directory /etc/pam.d

My address is jamor AT zentyal.com

Thanks,

Javier

Javier Amor Garcia

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1225
  • Karma: +12/-0
    • View Profile
I have already received the files and they seem correct.

So it must be that the LDAP server is not running, because the __USERS__ group is stored on it.

Could you check if the ldap server is running?.
If it is not running, restarting the users module solve the problem?

raggar

  • Zen Apprentice
  • *
  • Posts: 21
  • Karma: +1/-0
    • View Profile
Re: Adding users gives error "root command set -e mkdir -p `dirname /home/****"
« Reply #10 on: February 15, 2013, 02:33:26 pm »
Code: [Select]
sudo service slapd status
 * slapd is running

Code: [Select]
sudo /etc/init.d/zentyal users status
EBox: status module users: [ RUNNING ]

Both are running, a restart doesn't help...  :'(

Any other ideas?

This problem has started with going back to a previous backup.

Could it have to do with changing the hostname? the current hostname is 'instructure.nl'

Javier Amor Garcia

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1225
  • Karma: +12/-0
    • View Profile
Re: Adding users gives error "root command set -e mkdir -p `dirname /home/****"
« Reply #11 on: February 15, 2013, 04:25:02 pm »
ok, so the slapd is not the probelm.

Could you get information about this group from the console?. Use this command:

Code: [Select]
getent group __USERS__
You say that the problem originated form restoring the backup. /Restoring the backup restored a different hostname or you changed it later?. Do you know any difference between the backed up state and the previous state which could raise suspicion?

raggar

  • Zen Apprentice
  • *
  • Posts: 21
  • Karma: +1/-0
    • View Profile
Re: Adding users gives error "root command set -e mkdir -p `dirname /home/****"
« Reply #12 on: February 15, 2013, 05:54:33 pm »
It gives me:
Code: [Select]
getent group __USERS__
__USERS__:*:1901:

I changed the hostname after making the backup but before restoring. That is the only thing I could think off. Would it help if I send you the backup files (before and after)?

Javier Amor Garcia

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1225
  • Karma: +12/-0
    • View Profile
Re: Adding users gives error "root command set -e mkdir -p `dirname /home/****"
« Reply #13 on: February 15, 2013, 06:48:03 pm »
Yes, please send them to me.

lhx1

  • Zen Apprentice
  • *
  • Posts: 7
  • Karma: +2/-0
    • View Profile
Re: Adding users gives error "root command set -e mkdir -p `dirname /home/****"
« Reply #14 on: February 15, 2013, 09:26:32 pm »
Hi if it helps, I have the same problem. 

But I have not recently restored from backup.
Additionally, I have not recently changed the box's domain name.

Liam