When is root not root, & when root isn't root config ???

Ask questions about Arch Linux ARM. Please search before making a new topic.

When is root not root, & when root isn't root config ???

Postby g8jvm » Thu May 02, 2013 9:02 pm

Who has ownership of a process started by systemctl ?
It doesn't seem to be root, although it should be.
when motion is started by root from CLI and invokes mailx , mailx reads /root/.mailrc
when motion is started from systemctl and invokes mailx, mailx does not read /root/.mailrc.

So if root isn't root where does .mailrc need to be put so it is read by mailx when invoked by a application started by systemctl, which should be root.
Thanks
Richard
Best wishes
Richard
richard@g8jvm.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ham Call: G8JVM , QRA IO82SP38 interests weak signal propagation
VHF to microwave, http://www.g8jvm.com
g8jvm
 
Posts: 93
Joined: Mon Apr 22, 2013 4:40 pm
Location: United Kingdom

Re: When is root not root, & when root isn't root config ???

Postby pepedog » Thu May 02, 2013 9:33 pm

I think it might be a PATH issue?
Like with cron jobs, you have to specify full path to binary
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: When is root not root, & when root isn't root config ???

Postby g8jvm » Thu May 02, 2013 9:45 pm

Hi
I think you missed the point.
the binary for mailx is found without any problem, it is its config file which is in /root which is not being read, so mailx is not passing the originator to msmtp.
and using the -r switch is stopping the mail being sent, so .mailrc MUST be read
Tia
Richard
Best wishes
Richard
richard@g8jvm.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ham Call: G8JVM , QRA IO82SP38 interests weak signal propagation
VHF to microwave, http://www.g8jvm.com
g8jvm
 
Posts: 93
Joined: Mon Apr 22, 2013 4:40 pm
Location: United Kingdom

Re: When is root not root, & when root isn't root config ???

Postby WarheadsSE » Fri May 03, 2013 12:39 am

According to http://linux.die.net/man/1/mailx the environment variable 'MAILRC' should be set for this.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: When is root not root, & when root isn't root config ???

Postby g8jvm » Fri May 03, 2013 8:20 pm

Hi
I went thru that version of the man page carefully, but there is still something very strange going on even when the
environment variable is set.
I've set the MAILRC env i rc.local and also out it in manually.
REbooted, and the behaviour exactly the same the mailrc file is not being read.

I made a change in the motion.conf file that needed a restart , and I used killall motion && motion instead of
systemctl restart motion.service.

When motion restarted and invoked mailx it read the mailrc file and the from mail header was as it should be.
restarted motion with systemctl restart and it still continued to read the mailrc file., mail from header correct.

I've rebooted several times and each time motion is started by systemctl, and each time the mailrc file is not read.
Any idea why when motion is started as a daemon from CLI the mailrc file is read, and subsequent restarting with systemctl
the mailrc file is read.
There are now three identical copies
/root/MAILRC /root/.mailrc and /etc/mailrc
I would like its behaviour to be reading mailrc after a reboot, so should it get power cycled it starts in its correct condition.
very strange behaviour.
I dont know how to find out who owned a run process, ps only lists current processes, and I've looked in /var/log/everything.log.
Maybe if I could find out the logged identity of the process starting mailx , it may be possible to find a solution
TIAQ
Richard
Best wishes
Richard
richard@g8jvm.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ham Call: G8JVM , QRA IO82SP38 interests weak signal propagation
VHF to microwave, http://www.g8jvm.com
g8jvm
 
Posts: 93
Joined: Mon Apr 22, 2013 4:40 pm
Location: United Kingdom


Return to User Questions

Who is online

Users browsing this forum: No registered users and 6 guests