Re: Shell scripts: variable assignment within read loops

2008-08-18 Thread Giorgos Keramidas
On Mon, 18 Aug 2008 14:33:05 +0200, Polytropon [EMAIL PROTECTED] wrote: As I thought while reading your message, awk seems to be a good solution. Just a note: On Mon, 18 Aug 2008 06:29:03 +0300, Giorgos Keramidas [EMAIL PROTECTED] wrote: Would you be ok with an awk(1) script instead of

Shell scripts: variable assignment within read loops

2008-08-17 Thread David Wolfskill
I am writing a (Bourne) shell script that is intended (among other things) to obtain information from a command, such as: netstat -nibd -f inet by reading and parsing the output. However, the obvious (to me) approach of piping the output of the command to the standard input of a while

Re: Shell scripts: variable assignment within read loops

2008-08-17 Thread Giorgos Keramidas
Near section `` 2.12 Shell Execution Environment'' you can find the text I quoted. What I usually do in similar shell scripts is something like: cat ${filename} | sed -n -e '/foo/ s/bar/baz/' | \ xargs -n1 blah This isn't exactly the same as assigning $foo to the results of the loop

Re: Shell scripts: variable assignment within read loops

2008-08-17 Thread David Wolfskill
On Mon, Aug 18, 2008 at 06:29:03AM +0300, Giorgos Keramidas wrote: ... You are right that feeding data to a looping construct through a pipe may run in a subshell. The ``Single UNIX Specification'' says Ah; thanks for the confirmation. ... What I usually do in similar shell scripts

Changing 'From:' address of periodic scripts

2008-08-11 Thread Jonathan Belson
Hiya I set up a remote box to e-mail 'periodic' output to me directly. It has now stopped working, and I suspect it's because the 'From:' addresses of the status e-mails is of the form '[EMAIL PROTECTED]' and the ISP has upped its anti-spam checks. I see /usr/sbin/periodic itself uses the

Re: Changing 'From:' address of periodic scripts

2008-08-11 Thread Greg Larkin
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jonathan Belson wrote: | Hiya | | I set up a remote box to e-mail 'periodic' output to me directly. It | has now | stopped working, and I suspect it's because the 'From:' addresses of the | status | e-mails is of the form '[EMAIL PROTECTED]' and the

Re: carp interface and running manual scripts

2008-08-08 Thread Christopher Cowart
of arbitrary scripts. -- Chris Cowart Network Technical Lead Network Infrastructure Services, RSSP-IT UC Berkeley pgp5Z7EgST3cI.pgp Description: PGP signature

Re: Periodic scripts running twice

2008-08-05 Thread CyberLeo Kitsana
RW wrote: On Mon, 04 Aug 2008 13:21:36 -0500 CyberLeo Kitsana [EMAIL PROTECTED] wrote: Hi! For a while, I've noticed odd behavior with periodic scripts installed by certain ports (portaudit) as well as ones I've penned myself (corescan), in that they appear to be run twice in succession every

carp interface and running manual scripts

2008-08-05 Thread Omer Faruk SEN
Hi, Is it possible to run a script after carp interface becomes MASTER? Ie external script that runs the required services.. -- Best regards, Omer mailto:[EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list

[Solved] Re: Periodic scripts running twice

2008-08-05 Thread CyberLeo Kitsana
CyberLeo Kitsana wrote: RW wrote: On Mon, 04 Aug 2008 13:21:36 -0500 CyberLeo Kitsana [EMAIL PROTECTED] wrote: Hi! For a while, I've noticed odd behavior with periodic scripts installed by certain ports (portaudit) as well as ones I've penned myself (corescan), in that they appear to be run

Periodic scripts running twice

2008-08-04 Thread CyberLeo Kitsana
Hi! For a while, I've noticed odd behavior with periodic scripts installed by certain ports (portaudit) as well as ones I've penned myself (corescan), in that they appear to be run twice in succession every time. Base system scripts, and some add-on scripts (freshclam) are run only once

Re: Periodic scripts running twice

2008-08-04 Thread RW
On Mon, 04 Aug 2008 13:21:36 -0500 CyberLeo Kitsana [EMAIL PROTECTED] wrote: Hi! For a while, I've noticed odd behavior with periodic scripts installed by certain ports (portaudit) as well as ones I've penned myself (corescan), in that they appear to be run twice in succession every time

priority or order for /usr/local/etc/rc.d scripts?

2008-06-30 Thread fred
Hi guys, Basically, I have 2 scripts in the folder “/usr/local/etc/rc.d/” Resin.sh and apache.sh I need resin to be started when apache is starting, how can I do that? I can’t find any documentation on priority or order for startup scripts. I have tried adding a line at the end

Re: priority or order for /usr/local/etc/rc.d scripts?

2008-06-30 Thread Derek Ragona
At 03:37 PM 6/30/2008, fred wrote: Hi guys, Basically, I have 2 scripts in the folder /usr/local/etc/rc.d/ Resin.sh and apache.sh I need resin to be started when apache is starting, how can I do that? I can't find any documentation on priority or order for startup scripts. I have

Re: priority or order for /usr/local/etc/rc.d scripts?

2008-06-30 Thread Paul Schmehl
--On June 30, 2008 4:37:47 PM -0400 fred [EMAIL PROTECTED] wrote: Hi guys, Basically, I have 2 scripts in the folder “/usr/local/etc/rc.d/” Resin.sh and apache.sh I need resin to be started when apache is starting, how can I do that? I can’t find any documentation on priority or order

Re: priority or order for /usr/local/etc/rc.d scripts?

2008-06-30 Thread Andrew Wright
Regarding the order of rc scripts, On Mon, 30 Jun 2008, fred wrote: I need resin to be started when apache is starting, how can I do that? I can?t find any documentation on priority or order for startup scripts. The rcorder(8) page will help you out. Note the PROVIDE and REQUIRE keywords

Re: priority or order for /usr/local/etc/rc.d scripts?

2008-06-30 Thread Roland Smith
On Mon, Jun 30, 2008 at 04:37:47PM -0400, fred wrote: Hi guys, Basically, I have 2 scripts in the folder /usr/local/etc/rc.d/ Resin.sh and apache.sh Are these the scripts provided by the ports? They should be installed without the '.sh' extension. See rc(8). I need resin to be started

Re: rc scripts

2008-06-30 Thread David Allen
On Fri, Jun 27, 2008 at 3:01 PM, Derek Ragona [EMAIL PROTECTED] wrote: At 04:11 PM 6/27/2008, David Allen wrote: I need to an '-s' flag to the execution of openntpd's rc script: The problems I'm having are multiple. First, the program doesn't offer any logging, and running it with the do

Re: rc scripts

2008-06-30 Thread David Allen
does adding the usual scriptname_flags directive to /etc/rc.conf. Scriptname_flags doesn't work because the port maintainer didn't write the startup script so that it parses rc.conf for variables. You can edit the script like this: command_args=-s When rc.subr runs scripts, it runs them like

rc scripts

2008-06-27 Thread David Allen
I need to an '-s' flag to the execution of openntpd's rc script: # PROVIDE: openntpd # REQUIRE: DAEMON # BEFORE: LOGIN # KEYWORD: nojail . /etc/rc.subr name=openntpd rcvar=`set_rcvar` command=/usr/local/sbin/ntpd required_files=/usr/local/etc/ntpd.conf

Re: rc scripts

2008-06-27 Thread Derek Ragona
At 04:11 PM 6/27/2008, David Allen wrote: I need to an '-s' flag to the execution of openntpd's rc script: # PROVIDE: openntpd # REQUIRE: DAEMON # BEFORE: LOGIN # KEYWORD: nojail . /etc/rc.subr name=openntpd rcvar=`set_rcvar` command=/usr/local/sbin/ntpd

Re: rc scripts

2008-06-27 Thread Paul Schmehl
. Scriptname_flags doesn't work because the port maintainer didn't write the startup script so that it parses rc.conf for variables. You can edit the script like this: command_args=-s When rc.subr runs scripts, it runs them like this: ${command} ${command_args} ${command_flags} Or you can add

Re: start up scripts stopped working

2008-04-15 Thread Frank Shute
On Mon, Apr 14, 2008 at 01:37:41PM -0600, Eric Zimmerman wrote: Eric Zimmerman wrote: Frank Shute wrote: I spotted a couple of things with your rc.conf that could be causing you trouble: 1) There are a lot of unquoted YES's for enabling services. I don't know if that could screw thing's

Re: start up scripts stopped working

2008-04-14 Thread Jerry McAllister
On Sun, Apr 13, 2008 at 01:02:45PM -0600, Eric wrote: hello, does anyone know what I can do to fix the following problem? Every time my FreeBSd 6.2 machine reboots, none of the scripts in the /usr/local/etc/rc.d directory launch the various programs i have defined in my rc.conf file

Re: start up scripts stopped working

2008-04-14 Thread Eric Zimmerman
Jerry McAllister wrote: to rc.conf i see things getting evaluated, but nothing is launched. this forces someone to log in locally to the machine and start openssh so i can get to the box. Are there startup scripts for these things in rc.d? Putting something in rc.conf is only setting a flag

Re: start up scripts stopped working

2008-04-14 Thread Frank Shute
On Sun, Apr 13, 2008 at 07:18:52PM -0600, Eric wrote: tomasz dereszynski wrote: Eric wrote: hello, does anyone know what I can do to fix the following problem? Every time my FreeBSd 6.2 machine reboots, none of the scripts in the /usr/local/etc/rc.d directory launch the various

Re: start up scripts stopped working

2008-04-14 Thread Eric Zimmerman
Frank Shute wrote: I spotted a couple of things with your rc.conf that could be causing you trouble: 1) There are a lot of unquoted YES's for enabling services. I don't know if that could screw thing's up but for form's sake, I'd try quoting them and rebooting. 2) You seem to have set your

Re: start up scripts stopped working

2008-04-14 Thread Eric Zimmerman
Eric Zimmerman wrote: Frank Shute wrote: I spotted a couple of things with your rc.conf that could be causing you trouble: 1) There are a lot of unquoted YES's for enabling services. I don't know if that could screw thing's up but for form's sake, I'd try quoting them and rebooting. 2) You

start up scripts stopped working

2008-04-13 Thread Eric
hello, does anyone know what I can do to fix the following problem? Every time my FreeBSd 6.2 machine reboots, none of the scripts in the /usr/local/etc/rc.d directory launch the various programs i have defined in my rc.conf file. when i added rc_info=yes rc_debug=yes to rc.conf i see

Re: start up scripts stopped working

2008-04-13 Thread Derek Ragona
At 02:02 PM 4/13/2008, Eric wrote: hello, does anyone know what I can do to fix the following problem? Every time my FreeBSd 6.2 machine reboots, none of the scripts in the /usr/local/etc/rc.d directory launch the various programs i have defined in my rc.conf file. when i added rc_info

Re: start up scripts stopped working

2008-04-13 Thread tomasz dereszynski
Eric wrote: hello, does anyone know what I can do to fix the following problem? Every time my FreeBSd 6.2 machine reboots, none of the scripts in the /usr/local/etc/rc.d directory launch the various programs i have defined in my rc.conf file. when i added rc_info=yes rc_debug=yes

Re: start up scripts stopped working

2008-04-13 Thread Eric
tomasz dereszynski wrote: Eric wrote: hello, does anyone know what I can do to fix the following problem? Every time my FreeBSd 6.2 machine reboots, none of the scripts in the /usr/local/etc/rc.d directory launch the various programs i have defined in my rc.conf file. when i added

FreeBSD-4.11 rc.d / startup scripts?

2008-03-31 Thread fred
Hello, Google searches doesn’t help much, I am trying to restart, for example the SSHd service without having to reboot the server, but I have noticed that there is no /etc/rc.d on FreeBSD-4.11 and /usr/local/etc/rc.d is empty. Can anyone tell me where do I need to go to do a “sshd

Re: FreeBSD-4.11 rc.d / startup scripts?

2008-03-31 Thread Kris Kennaway
fred wrote: Hello, Google searches doesn’t help much, I am trying to restart, for example the SSHd service without having to reboot the server, but I have noticed that there is no /etc/rc.d on FreeBSD-4.11 and /usr/local/etc/rc.d is empty. Can anyone tell me where do I need to go to do

disable periodic scripts

2008-03-30 Thread Warner Lambert
Hi How can I disable those nightly/monthly/... periodic scripts? I don't need them, these days professional monitoring software such as nagios is used to monitor 200+ systems. I can't read 200 mails showing me hundreds of lines of output even if nothings happening. Am I just deleting all

Re: disable periodic scripts

2008-03-30 Thread Bruce Cran
Warner Lambert wrote: Hi How can I disable those nightly/monthly/... periodic scripts? I don't need them, these days professional monitoring software such as nagios is used to monitor 200+ systems. I can't read 200 mails showing me hundreds of lines of output even if nothings happening. Am I

Re: disable periodic scripts

2008-03-30 Thread D Hill
On Sun, 30 Mar 2008 at 22:26 +0100, [EMAIL PROTECTED] confabulated: Warner Lambert wrote: Hi How can I disable those nightly/monthly/... periodic scripts? I don't need them, these days professional monitoring software such as nagios is used to monitor 200+ systems. I can't read 200 mails

Re: disable periodic scripts

2008-03-30 Thread RW
On Sun, 30 Mar 2008 15:18:12 -0400 Warner Lambert [EMAIL PROTECTED] wrote: Hi How can I disable those nightly/monthly/... periodic scripts? I don't need them, these days professional monitoring software such as nagios is used to monitor 200+ systems. I can't read 200 mails showing me

Re: remote startup scripts

2008-03-02 Thread Alex Zbyslaw
Björn König wrote: I have a setup where /usr/local is actually not a local file system. It's NFS. My problem is that the initialization scripts doesn't seem to consider that startup scripts could be remote. Am I right or are there options that I missed yet? I assume the problem is that /usr

remote startup scripts

2008-03-01 Thread Björn König
Hello, I have a setup where /usr/local is actually not a local file system. It's NFS. My problem is that the initialization scripts doesn't seem to consider that startup scripts could be remote. Am I right or are there options that I missed yet? Please don't tell me that /usr/local is intended

Re: Setting Variables in expect Scripts From Shell Output

2008-02-26 Thread Martin McCormick
Roger Olofsson writes: If you're not too worried about speed my old trick to circumvent this was to simply write the variable to a temporary file then read in that file for the send_user thing later on...Providing the send_user is a script, mind you. An excellent idea. I just wanted to

Setting Variables in expect Scripts From Shell Output

2008-02-25 Thread Martin McCormick
While running an expect script, is it possible to set an expect script variable to the string kept in a shell variable? I can generate the shell variable just fine but when I try to export it to the expect script for later use with something like: set LOGFILENAME [exec echo

Re: Setting Variables in expect Scripts From Shell Output

2008-02-25 Thread Roger Olofsson
Martin McCormick skrev: While running an expect script, is it possible to set an expect script variable to the string kept in a shell variable? I can generate the shell variable just fine but when I try to export it to the expect script for later use with something like: set

Re: rc.d scripts not being run at shutdown.

2008-02-12 Thread Lowell Gilbert
of mergemaster. All the scripts under /etc should be the ones in the repository. And now I come to think about it, I was tinkering with a random number script at the exact time the entropy file was written-out, and I'm pretty certain I wrote it myself. That means I have no evidence

Re: rc.d scripts not being run at shutdown.

2008-02-11 Thread RW
, and the file wasn't touched (and I have tried running the touch manually). I should also add that this problem has survived a world+kernel rebuild to 7.0-RC2, which included the use of mergemaster. All the scripts under /etc should be the ones in the repository. Is anything showing up in the log

Re: rc.d scripts not being run at shutdown.

2008-02-11 Thread Jonathan Chen
On Mon, Feb 11, 2008 at 06:06:47PM +, RW wrote: On Sun, 10 Feb 2008 04:02:15 + RW [EMAIL PROTECTED] wrote: Afer putting in some extra logging to check something, I've just noticed that my rc.d scripts are not being run at shutdown. Did you remember to put: # KEYWORD

Re: rc.d scripts not being run at shutdown.

2008-02-11 Thread RW
tried it with an rc.shutdown script that contains only the touch statement, and the file wasn't touched (and I have tried running the touch manually). I should also add that this problem has survived a world+kernel rebuild to 7.0-RC2, which included the use of mergemaster. All the scripts

Re: rc.d scripts not being run at shutdown.

2008-02-11 Thread Lowell Gilbert
RW [EMAIL PROTECTED] writes: On Sun, 10 Feb 2008 04:02:15 + RW [EMAIL PROTECTED] wrote: Afer putting in some extra logging to check something, I've just noticed that my rc.d scripts are not being run at shutdown. By way of confirmation, my entropy file, which is written out

Re: /usr/local/etc/rc.d/ scripts and non-root user

2008-02-11 Thread Alex Zbyslaw
Matthew Seaman wrote: [EMAIL PROTECTED] wrote: On Wed, 06 Feb 2008, Alex Zbyslaw wrote Setuid/gid bits on shell scripts aren't considered safe, however and may even be disabled. THERE IS NO REASON FOR THIS, JUST USE THE FILE-SYSTEM TO PROTECT THE FILES (MAKE THEM NOT WRITEABLE

Re: rc.d scripts not being run at shutdown.

2008-02-11 Thread RW
On Sun, 10 Feb 2008 04:02:15 + RW [EMAIL PROTECTED] wrote: Afer putting in some extra logging to check something, I've just noticed that my rc.d scripts are not being run at shutdown. By way of confirmation, my entropy file, which is written out by an rc.d script, has not been

Re: /usr/local/etc/rc.d/ scripts and non-root user

2008-02-10 Thread [EMAIL PROTECTED]
On Wed, 06 Feb 2008, Alex Zbyslaw wrote SNIP Setuid/gid bits on shell scripts aren't considered safe, however and may even be disabled. THERE IS NO REASON FOR THIS, JUST USE THE FILE-SYSTEM TO PROTECT THE FILES (MAKE THEM NOT WRITEABLE). Scripts are no more susceptible

Re: /usr/local/etc/rc.d/ scripts and non-root user

2008-02-10 Thread Matthew Seaman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 [EMAIL PROTECTED] wrote: On Wed, 06 Feb 2008, Alex Zbyslaw wrote SNIP Setuid/gid bits on shell scripts aren't considered safe, however and may even be disabled. THERE IS NO REASON FOR THIS, JUST USE THE FILE-SYSTEM

Re: /usr/local/etc/rc.d/ scripts and non-root user

2008-02-10 Thread Jonathan McKeown
On Sunday 10 February 2008 11:13, Matthew Seaman wrote: [EMAIL PROTECTED] wrote: On Wed, 06 Feb 2008, Alex Zbyslaw wrote SNIP Setuid/gid bits on shell scripts aren't considered safe, however and may even be disabled. THERE IS NO REASON FOR THIS, JUST USE

rc.d scripts not being run at shutdown.

2008-02-09 Thread RW
Afer putting in some extra logging to check something, I've just noticed that my rc.d scripts are not being run at shutdown. By way of confirmation, my entropy file, which is written out by an rc.d script, has not been written to for a week (I shut-down most nights). I don't recall doing

/usr/local/etc/rc.d/ scripts and non-root user

2008-02-06 Thread Zbigniew Szalbot
Hello, I have looked at my /usr/local/etc/rc.d/ and realized that the symlink I put there has the root as owner. It all works but I would rather use a non-root user for to run that script. $ ls -l /usr/local/etc/rc.d/ lrwxr-xr-x 1 root wheel40 May 9 2007 sender.sh -

Re: /usr/local/etc/rc.d/ scripts and non-root user

2008-02-06 Thread Lowell Gilbert
cron(8) for this (it has an @reboot value for the crontab files), but for using startup scripts, I think the best way is to use su(1) in the script to execute particular commands. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org

Re: /usr/local/etc/rc.d/ scripts and non-root user

2008-02-06 Thread Alex Zbyslaw
Zbigniew Szalbot wrote: Hello, I have looked at my /usr/local/etc/rc.d/ and realized that the symlink I put there has the root as owner. It all works but I would rather use a non-root user for to run that script. $ ls -l /usr/local/etc/rc.d/ lrwxr-xr-x 1 root wheel40 May 9 2007

Re: /usr/local/etc/rc.d/ scripts and non-root user

2008-02-06 Thread Zbigniew Szalbot
a better solution may be to use cron for automatic startups, which Lowell rightly pointed out to me. I just loved the simplicity of symlinking sh scripts against /usr/local/etc/rc.d/ :) Thank you! Zbigniew Szalbot ___ freebsd-questions@freebsd.org mailing

Re: /usr/local/etc/rc.d/ scripts and non-root user

2008-02-06 Thread Alex Zbyslaw
/etc/rc.d/sender.sh to know what was set or not. Specifically, startup scripts will always run as root and it will be up to the script to do things as another user if appropriate. E.g. by using su, or sudo, or by running a program which was setuid some-other-user, or because it runs as root

Re: /usr/local/etc/rc.d/ scripts and non-root user

2008-02-06 Thread Zbigniew Szalbot
2008/2/6, Alex Zbyslaw [EMAIL PROTECTED]: Zbigniew Szalbot wrote: I have looked at my /usr/local/etc/rc.d/ and realized that the symlink I put there has the root as owner. It all works but I would rather use a non-root user for to run that script. $ ls -l /usr/local/etc/rc.d/ lrwxr-xr-x

Re: /usr/local/etc/rc.d/ scripts and non-root user

2008-02-06 Thread Alex Zbyslaw
be to use cron for automatic startups, which Lowell rightly pointed out to me. I just loved the simplicity of symlinking sh scripts against /usr/local/etc/rc.d/ :) I personally much prefer scripts in rc.d because it's much easier to migrate than crontabs, and if I never use a crontab I always know

Re: /usr/local/etc/rc.d/ scripts and non-root user

2008-02-06 Thread Alex Zbyslaw
Zbigniew Szalbot wrote: I have never really understood the thing about setuids, gid and etc. :) I am not planning a restart so won't try it but I am pretty sure that logs are created by root unless the api is started manually. No big deal really but thanks for all the suggestions! It's very

Re: /usr/local/etc/rc.d/ scripts and non-root user

2008-02-06 Thread RW
On Wed, 06 Feb 2008 17:09:50 + Alex Zbyslaw [EMAIL PROTECTED] wrote: I personally much prefer scripts in rc.d because it's much easier to migrate than crontabs, and if I never use a crontab I always know where to look. It looks to me like you shouldn't be starting the demon as user api

home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Steve Franks
I keep reading about making sh scripts executable with #!/bin/sh on the first line and chmod to executable. That works with all my system scripts (rc, etc.) or my system would be DOA, no doubt. When I do it in my home folder, however, running script gives command not found. I've only read about

RE: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Barry Byrne
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Franks Sent: 07 January 2008 15:53 I keep reading about making sh scripts executable with #!/bin/sh on the first line and chmod to executable. That works with all my system scripts (rc, etc

home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Robert Huff
Steve Franks writes: I keep reading about making sh scripts executable with #!/bin/sh on the first line and chmod to executable. That works with all my system scripts (rc, etc.) or my system would be DOA, no doubt. When I do it in my home folder, however, running script gives command

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Eric Crist
On Jan 7, 2008, at 9:52 AM, Steve Franks wrote: I keep reading about making sh scripts executable with #!/bin/sh on the first line and chmod to executable. That works with all my system scripts (rc, etc.) or my system would be DOA, no doubt. When I do it in my home folder, however, running

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Steve Franks
This is a sort of 'don't shoot yourself in the foot' design. You cannot run a script or binary simply by name if you're cwd is the directory that contains that script or binary. IIRC, you can't cd / usr/bin and run anything in /usr/bin without explicitly calling that file with the ./

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Josh Carroll
I keep reading about making sh scripts executable with #!/bin/sh on the first line and chmod to executable. That works with all my system scripts (rc, etc.) or my system would be DOA, no doubt. When I do it in my home folder, however, running script gives command not found. That typically

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Josh Carroll
How are you running the commands? The problem is probably to do with your path. Your home directory isn't typically and shouldn't be in your PATH (try echo $PATH). You need to specify the full path to your scripts or place a ./ in front of the script name if in the same directory. e.g

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Jim Bow
Hey Steve, Steve Franks wrote: Ah! You'd think any one of the many tutorials I read would have mentioned that little detail ;) Tutorials do have a tendency to look over important details. That's why I would always recommend a good book, something like UNIX Power Tools in your case, which,

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Erik Osterholm
On Mon, Jan 07, 2008 at 09:13:39AM -0700, Steve Franks wrote: This is a sort of 'don't shoot yourself in the foot' design. You cannot run a script or binary simply by name if you're cwd is the directory that contains that script or binary. IIRC, you can't cd / usr/bin and run anything in

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread James Harrison
On Mon, 2008-01-07 at 10:50 -0600, Erik Osterholm wrote: On Mon, Jan 07, 2008 at 09:13:39AM -0700, Steve Franks wrote: This is a sort of 'don't shoot yourself in the foot' design. You cannot run a script or binary simply by name if you're cwd is the directory that contains that script

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Mike Bristow
implciations, so if you think that it's something you really want to do, you'll have to find out from someone else how to do it. OTOH, having ~/bin in the path has no security implications at all - assuming your scripts are OK, of course. -- Shenanigans! Shenanigans!Best of 3! -- Flash

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Mike Jeays
a command), however this has serious security implciations, so if you think that it's something you really want to do, you'll have to find out from someone else how to do it. OTOH, having ~/bin in the path has no security implications at all - assuming your scripts are OK, of course. I don't

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Robert Huff
James Harrison writes: One example that comes to mind is the CUPS port. It installs its own version of the lpr binary in /usr/local/bin. However, there's also an instance of lpr, the BSD version, in /usr/bin. So how do you make sure you're using the CUPS version of the binary? The

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Bill Moran
- assuming your scripts are OK, of course. I don't see anything especially bad about putting . as the last item in the PATH on a personal desktop machine. It is convenient, IMHO worth the risk. If my desktop gets hacked, I have worse problems to worry about than this. Personally, I

Re: home dir executable (!/bin/sh, chmod+x) shell scripts won't run without sh script

2008-01-07 Thread Jonathan Chen
On Mon, Jan 07, 2008 at 01:21:46PM -0500, Robert Huff wrote: James Harrison writes: One example that comes to mind is the CUPS port. It installs its own version of the lpr binary in /usr/local/bin. However, there's also an instance of lpr, the BSD version, in /usr/bin. So how do you

Re: devilspie s-expression scripts?

2007-11-08 Thread Kevin Downey
On 11/6/07, Gary Kline [EMAIL PROTECTED] wrote: Looks like I can only put one Konsole or other app per workspace. Below, no matter with workspace I choose, 1 to 4, all these terminals go into just one workspace. Anybody know of any workaround? gary

Re: devilspie s-expression scripts?

2007-11-08 Thread Gary Kline
On Thu, Nov 08, 2007 at 11:45:02AM -0800, Kevin Downey wrote: On 11/6/07, Gary Kline [EMAIL PROTECTED] wrote: Looks like I can only put one Konsole or other app per workspace. Below, no matter with workspace I choose, 1 to 4, all these terminals go into just one

Re: term: Undefined variable emitted after startup scripts

2007-11-07 Thread Mark McConnell
On 1 Nov 2007 at 22:00, Andy Harrison wrote: {Re: term: Undefined variable emit...}: On 11/1/07, Mark McConnell wrote: On bootup, I see the message repeated several times, term: Undefined variable. Were any of the shell rc files change recently? Like root's .profile or .bashrc, or the

devilspie s-expression scripts?

2007-11-06 Thread Gary Kline
Looks like I can only put one Konsole or other app per workspace. Below, no matter with workspace I choose, 1 to 4, all these terminals go into just one workspace. Anybody know of any workaround? gary (if (and (is (application_name)

term: Undefined variable emitted after startup scripts

2007-11-01 Thread Mark McConnell
On bootup, I see the message repeated several times, term: Undefined variable. What is causing this message and what must I change to eliminate it? I want to rule it out as a factor contributing to my difficulty starting jabberd2 on bootup (c2s is the client-to-server component of

term: Undefined variable emitted after startup scripts

2007-11-01 Thread Mark McConnell
On bootup, I see the message repeated several times, term: Undefined variable. What is causing this message and what must I change to eliminate it? I want to rule it out as a factor contributing to my difficulty starting jabberd2 on bootup (c2s is the client-to-server component of

Re: term: Undefined variable emitted after startup scripts

2007-11-01 Thread Andy Harrison
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/1/07, Mark McConnell wrote: On bootup, I see the message repeated several times, term: Undefined variable. Were any of the shell rc files change recently? Like root's .profile or .bashrc, or the ones in /etc/? - -- Andy Harrison public

Re: Question about rc-scripts

2007-10-09 Thread Mel
On Tuesday 09 October 2007 03:07:22 Stephen Allen wrote: Hi Derek, Not all scripts create a pid file is the simple answer. I didn't see how the isc-dhcpd script or dovecot created a pid, so I assumed it was something that rc.subr took care of. Your script should create the pid file

Re: Question about rc-scripts

2007-10-09 Thread sdafreebsduk
shouldn't need to background the command. It /is/ a daemon Also, rather then an echo try adding -x to the shebang line. Yeah, I did that whilst I was re-arranging it. I think my problem is, I don't understand properly what creates the pids for the standard scripts (like nptd), so I can't look

Re: Question about rc-scripts

2007-10-09 Thread Chuck Swiger
On Oct 9, 2007, at 5:16 PM, [EMAIL PROTECTED] wrote: Most binaries i.e. httpd, memcached, mysqld, etc... provide a config file or cli option to provide the path to a pid file. Like you say - I can't find anything in rc.subr that would create a pid. So, I looked in /etc/rc.d/ntpd (for

Question about rc-scripts

2007-10-08 Thread Stephen Allen
' command though, it blanks out the contents of the pid. That echo line isn't present in any of the standard scripts - hence my initial question. Apart from variable assignments, the script defines 'start_cmd' (which I assume is used as the start command by rc.subr). Strange that I couldn't find any

Re: Question about rc-scripts

2007-10-08 Thread Derek Ragona
of the script. When you do a 'status' command though, it blanks out the contents of the pid. That echo line isn't present in any of the standard scripts - hence my initial question. Apart from variable assignments, the script defines 'start_cmd' (which I assume is used as the start command

Re: Question about rc-scripts

2007-10-08 Thread Stephen Allen
Hi Derek, Not all scripts create a pid file is the simple answer. I didn't see how the isc-dhcpd script or dovecot created a pid, so I assumed it was something that rc.subr took care of. Your script should create the pid file on start, remove it on stop, and simply cat that file on a status

Re: Question about rc-scripts

2007-10-08 Thread Philip M. Gollucci
Again, I thought the rc.subr functions took care of all that for you (unless you wanted something special from those commands). In general, they do see /etc/rc.subr: check_pidfile(), wait_for_pids(), Most binaries i.e. httpd, memcached, mysqld, etc... provide a config file or cli

Re: Question about rc-scripts

2007-10-08 Thread Philip M. Gollucci
Philip M. Gollucci wrote: Your particular problem is that run_rc_command actually exists so that the script exists with the correct return code generally that of what the application in question returns from trying to start or stop. s/exists/exits/g in the above.

Scripts for UNIX/SAMBA to LDAP user migration?

2007-08-29 Thread O. Hartmann
Hello, I'm looking for some utilities for the migration and maintenance of UNIX/SAMBA users to OpenLDAP. I would like to have some tools/scripts creating well defined LDIF files for importation into LDAP. Any tips or hints? Thank you very much in advance, Oliver

Re: Scripts for UNIX/SAMBA to LDAP user migration?

2007-08-29 Thread Mak Kolybabi
On 2007-08-29 12:10, O. Hartmann wrote: I'm looking for some utilities for the migration and maintenance of UNIX/SAMBA users to OpenLDAP. I would like to have some tools/scripts creating well defined LDIF files for importation into LDAP. AFAIK, these are the usual scipts used for that: http

Starting Scripts

2007-06-25 Thread Scott Mayo
start' for my instance of zope. I use to add lines like this to the rc.local file in linux to get them started. I was thinking that I read that this could still be done in FreeBSD, but was not the preferred way to do it. From looking at the scripts in '/usr/local/etc/rc.d', it looks like

Re: Starting Scripts

2007-06-25 Thread Kevin Kinsey
, not policy still applies. I use to add lines like this to the rc.local file in linux to get them started. I was thinking that I read that this could still be done in FreeBSD, but was not the preferred way to do it. From looking at the scripts in '/usr/local/etc/rc.d', it looks like

Re: Starting Scripts

2007-06-25 Thread RW
to do it. From looking at the scripts in '/usr/local/etc/rc.d', it looks like there are different ways. For zope it says that I can define 'zope28_enable : YES' in '/etc/rc.conf', '/etc/rc.conf.local' or '/etc/rc.conf/zope28', so I guess that I just add 'zope28_enable : YES' to my

Re: Starting Scripts

2007-06-25 Thread Scott Mayo
to do it. From looking at the scripts in '/usr/local/etc/rc.d', it looks like there are different ways. For zope it says that I can define 'zope28_enable : YES' in '/etc/rc.conf', '/etc/rc.conf.local' or '/etc/rc.conf/zope28', so I guess that I just add 'zope28_enable : YES' to my rc.conf

Questions about shell scripts in /etc/periodic/daily

2007-06-25 Thread Olivier Regnier
Hi everyone :-) Just curiosly, in /etc/periodic/daily, there are many shell scripts but there is an variable rc by example : - rc=0 - rc=1 - rc=2 - rc=3 What exactly does the rc=0, rc=1 ... flag mean ? Thank you :) ___ freebsd-questions@freebsd.org

<    1   2   3   4   5   6   >