Re: Running script from rc.d as local user
Lowell Gilbert <[EMAIL PROTECTED]> writes: > Gerard Seibert <[EMAIL PROTECTED]> writes: > >> On Thu, 08 Mar 2007 08:52:20 -0600 >> Derek Ragona <[EMAIL PROTECTED]> wrote: > >>> You should add a line: >>> /usr/bin/su [to your username] >> >> OK, I'll try that. > > A way to do this without needing special permissions to > touch system files is to use cron; it has an "@reboot" > time specification for this purpose. The original message finally arrived in my mailbox, so I see that you've already tried cron and didn't know how to set environmental variables that way. The answers are simple; set them in the crontab (usually on the command line you're executing), or write a wrapper script and call that from your crontab. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Running script from rc.d as local user
On Thu, 08 Mar 2007 09:24:47 -0500 Gerard Seibert <[EMAIL PROTECTED]> wrote: > I tried starting it from CRON; however, the variables: > > GPG_AGENT_INFO > GPG_TTY > > are not set.. > See crontab(5) ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Running script from rc.d as local user
Gerard Seibert <[EMAIL PROTECTED]> writes: > On Thu, 08 Mar 2007 08:52:20 -0600 > Derek Ragona <[EMAIL PROTECTED]> wrote: >> You should add a line: >> /usr/bin/su [to your username] > > OK, I'll try that. A way to do this without needing special permissions to touch system files is to use cron; it has an "@reboot" time specification for this purpose. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Running script from rc.d as local user
On Thu, 08 Mar 2007 08:52:20 -0600 Derek Ragona <[EMAIL PROTECTED]> wrote: > You need a first line in your script to choose what shell to run it: > #!/usr/local/bin/bash That is all ready in the script. Sorry, I inadvertently failed to disclose that. > > You should add a line: > /usr/bin/su [to your username] OK, I'll try that. > Then try it at bootup as an rc script. -- Gerard "I think he said 'Blessed are the cheesemakers.'" "Nonsense, he was obviously referring to all manufacturers of dairy products." The Life of Brian signature.asc Description: PGP signature
Re: Running script from rc.d as local user
You need a first line in your script to choose what shell to run it: #!/usr/local/bin/bash You should add a line: /usr/bin/su [to your username] Then try it at bootup as an rc script. -Derek At 08:24 AM 3/8/2007, Gerard Seibert wrote: I am trying to get gpg-agent to start at boot time. If I place this in the ~/.bash_profile file, the program starts correctly. GPG_TTY=`tty` export GPG_TTY # ## Start Agent ## if test -f $HOME/.gpg-agent-info \ && kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2>/dev/null; then GPG_AGENT_INFO=`cat $HOME/.gpg-agent-info` export GPG_AGENT_INFO else eval `gpg-agent --daemon` echo $GPG_AGENT_INFO >$HOME/.gpg-agent-info fi The problem is, if I log in again from a remote location, the .bash_login is read again and another copy of gpg-agent is started. Obviously, I do not want that behavior. I tried starting it from CRON; however, the variables: GPG_AGENT_INFO GPG_TTY are not set.. I then tried to create a script and run it from /usr/local/etc/rc.d; however, that forces the script to run as root, which I do not want. -- Gerard ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]" -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks transtec Computers for their support. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks transtec Computers for their support. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"