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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
08-04-2015, 07:38 AM
|
#1
|
Member
Registered: Jul 2011
Posts: 102
Rep:
|
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.
|
|
|
08-04-2015, 11:30 AM
|
#2
|
Slackware Contributor
Registered: May 2015
Distribution: Slackware
Posts: 1,911
|
I am no Gentoo expert, but I would guess that you need to be root to start and stop services.
|
|
|
08-05-2015, 12:47 AM
|
#3
|
Member
Registered: Jul 2011
Posts: 102
Original Poster
Rep:
|
who said i am not root?
|
|
|
08-06-2015, 11:58 AM
|
#4
|
Member
Registered: Aug 2004
Posts: 34
Rep:
|
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.
|
|
|
08-06-2015, 12:08 PM
|
#5
|
Slackware Contributor
Registered: May 2015
Distribution: Slackware
Posts: 1,911
|
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.
|
|
|
08-07-2015, 02:30 AM
|
#6
|
Member
Registered: Jul 2011
Posts: 102
Original Poster
Rep:
|
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.
|
|
|
08-07-2015, 02:45 AM
|
#7
|
Member
Registered: Aug 2004
Posts: 34
Rep:
|
The RunAs user ignored bit looks suspicious, what user does ps say the various sendmail processes running as?
|
|
|
08-07-2015, 03:21 AM
|
#8
|
Member
Registered: Jul 2011
Posts: 102
Original Poster
Rep:
|
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?
|
|
|
08-07-2015, 06:42 AM
|
#9
|
Member
Registered: Jan 2012
Posts: 72
Rep:
|
Either run your sendmail via root user. Or make user "smmsp" part of root group on system.
Check this and then reproduce the scenerio.
|
|
|
08-07-2015, 06:48 AM
|
#10
|
Member
Registered: Jan 2012
Posts: 72
Rep:
|
Also user running sendmail should include in trusted users list of sendmail configuration.
|
|
|
08-07-2015, 08:37 AM
|
#11
|
Member
Registered: Jul 2011
Posts: 102
Original Poster
Rep:
|
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?
|
|
|
08-07-2015, 11:51 AM
|
#12
|
Slackware Contributor
Registered: May 2015
Distribution: Slackware
Posts: 1,911
|
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.
|
|
|
08-10-2015, 01:25 AM
|
#13
|
Member
Registered: Jul 2011
Posts: 102
Original Poster
Rep:
|
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?
|
|
|
08-10-2015, 10:23 AM
|
#14
|
Slackware Contributor
Registered: May 2015
Distribution: Slackware
Posts: 1,911
|
Quote:
Originally Posted by Majed17
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.
|
|
|
08-12-2015, 03:24 AM
|
#15
|
Member
Registered: Jul 2011
Posts: 102
Original Poster
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 08:29 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|