LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-04-2015, 07:38 AM   #1
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Rep: Reputation: Disabled
cannot restart sendmail in gentoo


here is the output:
Code:
gentoo ~ # /etc/init.d/sendmail restart
 * Stopping sendmail ...
head: cannot open /var/run/sendmail.pid for reading: No such file or directory
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]                                                      [ !! ]
 * ERROR: sendmail failed to stop
when i create the file /var/run/sendmail.pid

it doesn't help:

Code:
gentoo ~ # /etc/init.d/sendmail restart
 * Stopping sendmail ...
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]                                                      [ !! ]
 * ERROR: sendmail failed to stop
in /var/log/messages :

Code:
Aug  4 15:31:30 localhost nagios[4392]: wproc:   stderr line 01: Program mode requires special privileges, e.g., root or TrustedUser.
Aug  4 15:31:30 localhost nagios[4392]: wproc:   stdout line 01: WARNING: RunAsUser for MSP ignored, check group ids (egid=1000, want=209)
Aug  4 15:31:30 localhost nagios[4392]: wproc:   stdout line 02: can not chdir(/var/spool/clientmqueue/): Permission denied
here are the permissions:

gentoo ~ # ls -l /var/spool
total 16
Code:
drwxrwx--- 2 smmsp smmsp 4096 Aug  4 15:30 clientmqueue
drwxr-x--- 4 root  cron  4096 Jul 31 16:50 cron
drwxrwsr-t 2 root  mail  4096 Aug  4 12:45 mail
drwxrwxrwx 2 root  mail  4096 Aug  4 15:02 mqueue
any idea what to look at?

Last edited by Majed17; 08-04-2015 at 09:37 AM.
 
Old 08-04-2015, 11:30 AM   #2
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,911

Rep: Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066
I am no Gentoo expert, but I would guess that you need to be root to start and stop services.
 
Old 08-05-2015, 12:47 AM   #3
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Original Poster
Rep: Reputation: Disabled
who said i am not root?
 
Old 08-06-2015, 11:58 AM   #4
nelz
Member
 
Registered: Aug 2004
Posts: 34

Rep: Reputation: 6
Creating the pidfile is no use if it doesn't contain the PID of the currently running sendmail process. An empty pidfile like you created would give just the error you are seeing. If the file is not there, it is likely sendmail is no longer running, you can run /etc/init.d/sendmail zap to let openrc know it is not running, then try restarting it. Then you only have to trawl the logs to find out when and why it stopped running.
 
Old 08-06-2015, 12:08 PM   #5
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,911

Rep: Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066
I searched for "ERROR: sendmail failed to stop" in google and duckduckgo and found:

https://forums.gentoo.org/viewtopic-...0-start-0.html

It may be unrelated. Have you tried searching all strings you quoted? There is lots to go through. I am not running Gentoo and I am also not running sendmail. So I really cannot do much troubleshooting passed using search engines with the keywords you have in your error messages.

EDIT:

Also, the following might be important to investigate:

Quote:
Aug 4 15:31:30 localhost nagios[4392]: wproc: stdout line 01: WARNING: RunAsUser for MSP ignored, check group ids (egid=1000, want=209)
Are you sure the right permissions / users / groups are all set for sendmail as well as for nagios?

Last edited by mralk3; 08-06-2015 at 12:12 PM.
 
Old 08-07-2015, 02:30 AM   #6
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Original Poster
Rep: Reputation: Disabled
well rolled back to before the problem occurred but after emerging sendmail it still starts slowly so i investigated the problem and it turns out that:

Code:
hostname -f
produces
127.0.0.1 localhost
so i edited the hosts file to include the hostname in the beginning, as such:
Code:
127.0.0.1 nagios localhost
and then sendmail started to work fast.

but the permission problem remains:

Code:
nagios nagios[3650]: wproc:   stderr line 01: Program mode requires special privileges, e.g., root or TrustedUser.
Aug  7 10:17:04 nagios nagios[3650]: wproc:   stdout line 01: WARNING: RunAsUser for MSP ignored, check group ids (egid=1000, want=209)
Aug  7 10:17:04 nagios nagios[3650]: wproc:   stdout line 02: can not chdir(/var/spool/clientmqueue/): Permission denied
when i try to send mail from command line, i get:
Code:
nagios sendmail[8645]: t777J1Cm008645: to=email adress ,great,test, ctladdr=root (0/0), delay=00:00:03, xdelay=00:00:00, mailer=relay, pri=90003, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: 421 4.3.0 collect: Cannot write ./dft777J4ZY008665 (bfcommit, uid=0, gid=209): Permission denied
the permissions to /var/spool are no as follows:

Code:
nagios ~ # ls -l /var/spool
total 16
drwxrwx--- 2 smmsp smmsp 4096 Aug  7 10:20 clientmqueue
drwxr-x--- 4 root  cron  4096 Jul 31 16:50 cron
drwxrwxr-x 2 mail  root  4096 Aug  7 09:37 mail
drwxr-xr-x 2 smmsp root  4096 Aug  7 09:38 mqueue
i'm sure it's a permission or/and ownership problem, but i just don't know what file or folder to check.
 
Old 08-07-2015, 02:45 AM   #7
nelz
Member
 
Registered: Aug 2004
Posts: 34

Rep: Reputation: 6
The RunAs user ignored bit looks suspicious, what user does ps say the various sendmail processes running as?
 
Old 08-07-2015, 03:21 AM   #8
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Original Poster
Rep: Reputation: Disabled
part of the output of ps -aux
Code:
smmsp     3822  0.0  0.5  34632  5448 pts/0    T    10:41   0:00 sendmail -s
root      6654  0.0  0.0      0     0 ?        S    11:14   0:00 [kworker/0:
root      7046  0.0  0.0      0     0 ?        S    11:19   0:00 [kworker/0:
nagios    7103  0.0  0.0  16448  1004 ?        S    11:19   0:00 /usr/local/
nagios    7104  0.0  0.0   4248   664 ?        S    11:19   0:00 /bin/ping -
root      7124  0.0  0.2  21204  2528 pts/0    R+   11:20   0:00 ps -aux
it should be as root?
 
Old 08-07-2015, 06:42 AM   #9
kamran.ayub
Member
 
Registered: Jan 2012
Posts: 72

Rep: Reputation: Disabled
Either run your sendmail via root user. Or make user "smmsp" part of root group on system.
Check this and then reproduce the scenerio.
 
Old 08-07-2015, 06:48 AM   #10
kamran.ayub
Member
 
Registered: Jan 2012
Posts: 72

Rep: Reputation: Disabled
Also user running sendmail should include in trusted users list of sendmail configuration.
 
Old 08-07-2015, 08:37 AM   #11
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Original Poster
Rep: Reputation: Disabled
i tired adding the smmsp user to root by changing the permissions in /etc/passwd:

it was :

Code:
smmsp:x:209:209:added by portage for sendmail:/var/spool/mqueue:/sbin/nologin
i made it :

Code:
smmsp:x:0:0:added by portage for sendmail:/var/spool/mqueue:/sbin/nologin
but after that sendmail failed to start, did i do something wrong or should i just add snmsp to wheel group?
 
Old 08-07-2015, 11:51 AM   #12
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,911

Rep: Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066
No, don't ever make a user on the system the same user id as root. Huge security risk. What you want to do is change that back to what it was. Then add the required user to the required group using the "usermod" command.

Here is a tutorial that describes how to add users to groups in Linux.

http://www.cyberciti.biz/faq/howto-l...user-to-group/

EDIT:
I commented earlier stating that the following is important:

Code:
Aug 4 15:31:30 localhost nagios[4392]: wproc: stdout line 01: WARNING: RunAsUser for MSP ignored, check group ids (egid=1000, want=209)
This suggests to me this process is running as group id 1000 and it wants to run as group id 209. I may be mistaken about this. This is why I suggested in my original post that you have the wrong permissions for the running services.

Also:

Quote:
Also user running sendmail should include in trusted users list of sendmail configuration.
This is important as well. Add the trusted users to the sendmail configuration. All users who will send email on this system need to be added as trusted users. I have no futher insight on this because I am accustomed to using Postfix instead of sendmail.

Last edited by mralk3; 08-07-2015 at 11:57 AM.
 
Old 08-10-2015, 01:25 AM   #13
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Original Poster
Rep: Reputation: Disabled
i tried adding the user to the root group:

Code:
nagios ~ # usermod -g root smmsp
nagios ~ # id smmsp
uid=209(smmsp) gid=0(root) groups=0(root)
nagios ~ # /etc/init.d/sendmail restart
 * Stopping sendmail ...                                              [ ok ]
 * Starting sendmail ...                                              [ ok ]
nagios ~ # sendmail -s "great test" email
raf
the result:

Code:
Aug 10 09:16:04 nagios sendmail[25042]: t7A6G2OP025042: to=email ,great,test, ctladdr=root (0/0), delay=00:00:02, xdelay=00:00:00, mailer=relay, pri=90004, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: 421 4.3.0 collect: Cannot write ./dft7A6G4e5025043 (bfcommit, uid=0, gid=209): Permission denied
then i did :

Code:
nagios ~ # usermod -g smmsp smmsp
nagios ~ # id smmsp
uid=209(smmsp) gid=209(smmsp) groups=209(smmsp)
nagios ~ # /etc/init.d/sendmail restart
 * Stopping sendmail ...                                              [ ok ]
 * Starting sendmail ...                                              [ ok ]
nagios ~ # sendmail -s "great test" email
wdfsv
i got:

Code:
Aug 10 09:19:38 nagios sendmail[25388]: t7A6JZNA025388: to=email,great,test, ctladdr=root (0/0), delay=00:00:03, xdelay=00:00:00, mailer=relay, pri=90003, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: 421 4.3.0 collect: Cannot write ./dft7A6Jcfw025391 (bfcommit, uid=0, gid=209): Permission denied
then i did:

Code:
nagios ~ # usermod -G smmsp,root smmsp
nagios ~ # id smmsp
uid=209(smmsp) gid=209(smmsp) groups=209(smmsp),0(root)
nagios ~ # /etc/init.d/sendmail restart
 * Stopping sendmail ...                                              [ ok ]
 * Starting sendmail ...                                              [ ok ]

nagios ~ # sendmail -s "great test" email
ewff
i got:

Code:
Aug 10 09:23:09 nagios sendmail[25759]: t7A6N7ZZ025759: to=email,great,test, ctladdr=root (0/0), delay=00:00:02, xdelay=00:00:00, mailer=relay, pri=90005, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: 421 4.3.0 collect: Cannot write ./dft7A6N9DT025760 (bfcommit, uid=0, gid=209): Permission denied
so he is root and is denied, or is it folder permissions?
 
Old 08-10-2015, 10:23 AM   #14
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,911

Rep: Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066Reputation: 1066
Quote:
Originally Posted by Majed17 View Post
Code:
Aug 10 09:16:04 nagios sendmail[25042]: t7A6G2OP025042: to=email ,great,test, ctladdr=root (0/0), delay=00:00:02, xdelay=00:00:00, mailer=relay, pri=90004, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: 421 4.3.0 collect: Cannot write ./dft7A6G4e5025043 (bfcommit, uid=0, gid=209): Permission denied
2
so he is root and is denied, or is it folder permissions?
I've searched google with many results discussing the proper permissions for sendmail directories / files. I suggest you try doing a bit of research. I do not have sendmail installed / configured and I am not on a Gentoo system. I am just guessing at this point what is wrong with your system. Maybe try reading the sendmail documentation on installation and configuration too?

It looks like it could either be that the sendmail process does not have the correct use / group permissions. It could also be that the directories / files sendmail is trying to access / write have the wrong permissions. In the case of this error, sendmail cannot create a file necessary for queuing up an email to be sent. I am not really sure though (assuming you didn't change anything) why a default installation of sendmail would be so broken on any Linux distribution.
 
Old 08-12-2015, 03:24 AM   #15
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Original Poster
Rep: Reputation: Disabled
for the permission error the solution is to,
set the directory /var/spool/mqueue to root:root and then,

Code:
chmod g+w /var/spool/mqueue
 
  


Reply

Tags
gentoo, sendmail


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to restart KDE in Calculate 13.6? [Gentoo] hawkfeather Linux - Newbie 2 10-30-2013 02:12 AM
[SOLVED] Sendmail restart problem T-Dub116 Linux - Software 1 10-05-2013 03:13 AM
Sendmail works but only after "sendmail restart" on RHEL 5 Tralobyte Linux - Server 2 06-15-2008 03:19 AM
After restart of router Sendmail theret79 Linux - Software 5 06-20-2006 02:28 PM
how to restart sendmail jhildebrand Slackware 6 11-13-2003 12:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration