Bug 231863 - pbs_server doesn't find sendmail
pbs_server doesn't find sendmail
Product: Fedora
Classification: Fedora
Component: torque (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Garrick Staples
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2007-03-12 13:12 EDT by Fabrice Bellet
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version: 2.1.8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-03-13 18:13:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Fabrice Bellet 2007-03-12 13:12:45 EDT

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
$ 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
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 14:26:36 EDT
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 15:24:35 EDT
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:


(*) 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 02:27:49 EDT
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 14:50:08 EDT
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 18:13:54 EDT
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 15:21:58 EDT
You're right, this is probably safer.

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