-
inetd question
Greetings,
How can I tell when inetd invokes a service (svnserve) I have listed in
my inetd.conf? I would like the system to beep by just executing a
command to beep on the command line which I already know.
This would probably involve writing a shell script that inetd invokes
instead of the service, with the script itself then invoking my service.
I don't know how to write the script. My inetd.conf looks like this...
# Subversion server...
svn stream tcp nowait root /opt/bin/svnserve -i -r /public/svnrepos
What would I replace that with and what would the script look like?
Kip
-
Re: inetd question
To sound a bell to the terminal depends on your Unix version (or rathe
on the kind of "echo" program that is available on your machine).
A BSD-like "echo" uses the "-n" option for suppressing the final
newline and does not understand the octal \nnn notation. Thus
the command is
echo -n '^G'
where ^G means a _literal_ BEL-character (you can produce thi
in
emacs using "Ctrl-Q Ctrl-G" and in vi using "Ctrl-V Ctrl-G").
A SysV-like "echo" understands the \nnn notation and uses \c to
suppress the final newline, so the answer is:
echo '\007\c'
So first play with the echo command until your hear the bell, the
create a shell script: For example:
#/bin/sh
/bin/echo '\007\c'
/opt/bin/svnserve -i -r /public/svnrepos
Enusre the script has the correct execute permission set then add th
command to inetd.conf, i.e.
svn stream tcp nowait root /myscript/myshellscript.sh
Obviously replace "/myscript/myshellscript.sh" for the correct path.
Hope that helps
--
harryedwards
-
Re: inetd question
harryedwards wrote:
[color=blue]
>
> To sound a bell to the terminal depends on your Unix version (or
> rather on the kind of "echo" program that is available on your
> machine).
>
> A BSD-like "echo" uses the "-n" option for suppressing the final
> newline and does not understand the octal \nnn notation. Thus
> the command is
>
> echo -n '^G'
>
> where ^G means a literal BEL-character (you can produce this
> in
> emacs using "Ctrl-Q Ctrl-G" and in vi using "Ctrl-V Ctrl-G").
>
> A SysV-like "echo" understands the \nnn notation and uses \c to
> suppress the final newline, so the answer is:
>
> echo '\007\c'
>
> So first play with the echo command until your hear the bell, then
> create a shell script: For example:
>
> #/bin/sh
> /bin/echo '\007\c'
> /opt/bin/svnserve -i -r /public/svnrepos
>
> Enusre the script has the correct execute permission set then add the
> command to inetd.conf, i.e.
>
> svn stream tcp nowait root /myscript/myshellscript.sh
>
> Obviously replace "/myscript/myshellscript.sh" for the correct path.
>
> Hope that helps.[/color]
Thanks Harry,
I have this in my launchsvn.sh after running chmod 755 on the script:
Set_Led beep1
Set_Led beep1
/opt/bin/svnserve -i -r /public/svnrepos
And in my inetd.conf, I have:
# Subversion server...
# svn stream tcp nowait root /opt/bin/svnserve -i -r /public/svnrepos
svn stream tcp nowait root /root/launchsvn.sh
The commented out line is the original working line and the one below
it is the new one.
The connection fails now from my Subversion client when I try to
connect to the server. Any ideas?
Kip
-
Re: inetd question
Got it to work. When I reset the machine to apply the inetd changes,
the IP changed so I was trying to get into the wrong machine. hehe.
Kip