Bug 231863 - pbs_server doesn't find sendmail
Summary: pbs_server doesn't find sendmail
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: torque
Version: 5
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Garrick Staples
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-03-12 17:12 UTC by Fabrice Bellet
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version: 2.1.8
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-03-13 22:13:54 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Fabrice Bellet 2007-03-12 17:12:45 UTC
Hi,

I'm running torque-2.1.6-1.fc5, and it appears that pbs_server cannot send
emails on jobs completion, because it doesn't find the sendmail binary (normally
located in /usr/sbin) :

$ strings /usr/sbin/pbs_server | grep sendmail
sendmail
$ ls -l /usr/sbin/sendmail
lrwxrwxrwx 1 root root 21 Dec 20 14:50 /usr/sbin/sendmail -> /etc/alternatives/mta



# strace -f -F -o /tmp/log -p `pidof pbs_server`
[...] 
submitting a job
[...]

# grep sendmail /tmp/log
6882  execve("/bin/sh", ["sh", "-c", "sendmail -f adm fabrice.bellet@c"...], [/*
2 vars */]) = 0
6882  stat64("/bin/sendmail", 0xbf96ab70) = -1 ENOENT (No such file or directory)
6882  stat64("/usr/bin/sendmail", 0xbf96ab70) = -1 ENOENT (No such file or
directory)
6882  write(2, "sh: sendmail: command not found\n", 32) = 32

--> as a workaround, creating a symlink for sendmail in /usr/bin works for me,
but it would be probably safer to hardcode the real sendmail path in the
configure scripts ?

Comment 1 Garrick Staples 2007-03-12 18:26:36 UTC
configure does look for sendmail and will hardcode the real path, but if it
isn't found, will simply rely on $PATH.

Since I didn't add sendmail as a buildreq in the FE rpm, it isn't found.  I'll
research the best way to solve this going forward in FE.

For now, you can simply add /usr/sbin to pbs_environment.

Comment 2 Fabrice Bellet 2007-03-12 19:24:35 UTC
Ah this fix looks good to me, thanks for the tip.

If an MTA is mandatory for the correct operation of pbs_server, then adding a
BuildRequires (*) and Requires for /usr/sbin/sendmail may be the solution,
because AFAIK, all MTA shipped in Fedora add a Provides: /usr/sbin/sendmail in
their package, and the correct MTA is selected with the 'alternatives'
mechanism. Here is a (recent) thread on this question:

https://www.redhat.com/archives/fedora-devel-list/2007-February/msg00182.html
https://www.redhat.com/archives/fedora-devel-list/2007-February/msg00183.html

(*) As the existence of /usr/sbin/sendmail is not checked at build time, when
forcing the --with-sendmail configure option, I'd say that the BuildRequires:
/usr/sbin/sendmail can be omited.

Comment 3 Garrick Staples 2007-03-13 06:27:49 UTC
If /usr/sbin/sendmail is the correct BR and Req, I'll add that to the next build
in FC6/FC7.  I don't think I'm allowed to do updates for FC5.

That post pointed me to paths.h, which defines _PATH_SENDMAIL.  I'm wondering
how standard and portable that is.

Comment 4 Garrick Staples 2007-03-13 18:50:08 UTC
I think a Req on smtpdaemon is the correct way to go here.  It seems to be the
proper virtual provides, but I will make sure the next FC6/FC7 builds have the
correct /usr/sbin/sendmail path in the binary.

Comment 5 Garrick Staples 2007-03-13 22:13:54 UTC
I just did 2.1.8 builds with --with-sendmail=/usr/sbin/sendmail, without added a
BR or Req.

I was about to add a Req but then got scared of making machines pull in the
wrong MTA.

I think the new build will work fine for people.

Comment 6 Fabrice Bellet 2007-03-14 19:21:58 UTC
You're right, this is probably safer.


Note You need to log in before you can comment on or make changes to this bug.