Hi all,
I have a small shell script that does a backup to a usb drive and emails
the results to a set of people. The script is triggered from devd (upon
drive attachment) and runs as root.
The problem is that the mail report is sent from an active system user
and not user root. The user the
Jim Bow <[EMAIL PROTECTED]> writes:
> I have a small shell script that does a backup to a usb drive and
> emails the results to a set of people. The script is triggered from
> devd (upon drive attachment) and runs as root.
>
> The problem is that the mail report is sent from an active system user
Lowell Gilbert wrote:
The answer will probably depend on the MTA you're using (which you
didn't mention, so it's probably sendmail)
You've guessed it. Its out-of-the-box sendmail.
Run the script from the command line and in particular just call
> mail the way the script does.
If I run the
[ apologies to Jim Bow who gets this twice due to my fingers typing
faster than my brain. ]
On Thu, Jan 10, 2008 at 10:46:30AM +, Jim Bow wrote:
> If I run the script (or just send a mail) on the command line using sudo,
> then it's sent as me and not root. Same happens if I su to root first.
Mike Bristow wrote:
On Thu, Jan 10, 2008 at 10:46:30AM +, Jim Bow wrote:
If I run the script (or just send a mail) on the command line using sudo,
then it's sent as me and not root. Same happens if I su to root first.
use 'su -'. It means you get a login shell (which sets up the enviromen
--On Thursday, January 10, 2008 13:22:47 + Jim Bow <[EMAIL PROTECTED]>
wrote:
Mike Bristow wrote:
On Thu, Jan 10, 2008 at 10:46:30AM +, Jim Bow wrote:
If I run the script (or just send a mail) on the command line using sudo,
then it's sent as me and not root. Same happens if I su to r
Paul Schmehl wrote:
I'm not sure what, but something is wrong. I did the exact same thing
you did, but the results are completely different.
The only difference I can spot is that you are using Postfix, while the
hosts I'm using all run standard Sendmail.
Could this be the problem? I might
On Thu, 10 Jan 2008 13:22:47 + Jim Bow <[EMAIL PROTECTED]> wrote:
> Mike Bristow wrote:
> > On Thu, Jan 10, 2008 at 10:46:30AM +, Jim Bow wrote:
> >> If I run the script (or just send a mail) on the command line using sudo,
> >> then it's sent as me and not root. Same happens if I su t
Ian Smith wrote:
paqi# alias um
tty;id -p;who am i
paqi# um
/dev/ttyp3
login smithi
uid root
groups wheel operator network
root ttyp3Jan 11 14:09
Note 'id -p' showing 'login smithi'; see id(1) .. I gather that sendmail
must also use getlogin(2) - which value does not appea