Thank you Jameson and everyone who replied! It did work. I used the
chpst and that did allow ssmtp to send email out. Later I will work on
using svlogd utility since I am still trying to learn the utilities in
runit.
Thank you once again.
Subba Rao
On 9/11/13 6:34 PM, Jameson Graef Rollins wrote:
> On Wed, Sep 11 2013, Subba Rao <umroute_at_tanucoo.com> wrote:
>> I am new to using runit. Long ago I have used djb's daemontools and now
>> I have switched to runit.
>>
>> Now I would like to setup a user level service which uses ssmtp to send
>> out reminders. The script looks as follows:
>>
>> ===============
>> #!/bin/sh
>> while :
>> do
>> ssmtp myemail_at_yahoo.com <mailto:myemail_at_yahoo.com> <
>> /home/user1/reminders/reminder1.txt
>> echo `date`: "Testing email script..." >> ./log.txt
>> sleep 5000
>> done
>> ===============
>>
>> All this was created as root on my Raspbian. The "log.txt" file has
>> entries for each interation but there is no email sent out. If I typed
>> in the ssmtp command in a terminal then the email does go out. What am
>> I missing here?
>>
>> I would like to setup this as a user level service. How do I do that?
> Hi, Subba. Look at the 'chpst' utility:
>
> chpst - runs a program with a changed process state
>
> It can be used to run a program with as an arbitrary user or group, with
> a specified environment, root, etc., e.g.:
>
> chpst -u user1 ssmtp ...
>
> You should also consider using runit's built in logging facility
> (svlogd), rather than writing your own log.
>
> hth.
>
> jamie.
Received on Thu Sep 12 2013 - 18:32:06 UTC
This archive was generated by hypermail 2.3.0
: Sun May 09 2021 - 19:44:18 UTC