Tiny Core Linux
Tiny Core Extensions => TCE Q&A Forum => Topic started by: rms46 on November 03, 2012, 10:04:29 PM
-
Hello,
I am able to setup the sshd (openssh). However, I have no idea to turn it "on" or "off" by using the Control Panel. Do I miss something or any documentation/URL?
Rahmat.
-
click on the desktop and use the "services" menu item to display the start/stop controls for daemons
-
click on the desktop and use the "services" menu item to display the start/stop controls for daemons
It does not work. I guess that there is a step that I have missed.
-
Is your sshd configured? Try starting "services" from a terminal and see if there are any messages toggling openssh.
-
I start openssh from within bootsync.sh with
/usr/local/etc/init.d/openssh startso I've never had occasion to start it from the services tool - I'd forgotten the tool was even there.
After reading the reply above I tried it out and found that, even though the ssh daemon is running, open ssh shows as off (no green light) on the services tool. If I click the openssh button on the services tool, the green light comes on for a couple of seconds and goes out again. The daemon remains running, still works and still has the same pid it had before. This doesn't seem right to me but perhaps I'm just unfamiliar with the tool?
-
I suspect the start fails as the port is already in use. Try starting it with the daemon not running.
-
The init.d script has to be written to interact with the services applet - see other extensions (for example bluez, dbus) for how this is done.
-
Thanks guys. Both right.
The start failed, but it was because I had started the services tool from the command line, as user tc. Without having examined the source code, I suspect cpanel starts the services tool as root, so services doesn't have to worry about explicitly starting the daemons as root. When I started services as root, it worked a little better - but still no green light.
I did a quick compare of the openssh start/stop script, against the tftp start/stop script and found that the one for openssh lacks the "status" functionality (which simply reports the pid of the running daemon, if any).
After adding the status functionality to the openssh script and running services as root, it appears to do work as expected.
-
(I am not sure if I should open a new thread or not)
What is the difference between /etc/init.d/ and
/usr/local/etc/init.d/ ?
There is a /etc/init.d/services/ directory for crond, tftpd, and dhcp.
Meanwhile openssh is in /usr/local/etc/init.d/
Rahmat.
-
The idea is that the base uses /etc and extensions use /usr/local/etc
-
The idea is that the base uses /etc and extensions use /usr/local/etc
Does "services" checks /usr/local/etc or is it a bug?
-
yes, services checks /usr/local/etc/init.d - bluez, dbus, cups, etc would not show otherwise ;)
-
Ah, yes. I have installed firefox which installs dbus.
Well then, to whom should I report the openssh problem?
-
What makes you think it is a problem?
-
What makes you think it is a problem?
Openssh (sshd) can not be turned on/off by services.
That is not a problem? No problem!
-
Did you check if sshd init.d has the couple of lines of code mentioned above?
-
Did you check if sshd init.d has the couple of lines of code mentioned above?
No. I have no idea how to implement:
The init.d script has to be written to interact with the services applet - see other extensions (for example bluez, dbus) for how this is done.
-
As an example, try this.
As root, do the following
* Make a copy of /usr/local/etc/init.d/openssh as /usr/local/etc/init.d/openssh2 and make it executable with chmod
* Edit the copy to add the line
status) pidof sshd;;right before the line that says
start) start;;and save it.
* Kill off the sshd process, if it is running
* Start the services applet. Use the new openssh2 button instead of the original openssh button
Don't forget to add the new script to your backup.
-
As an example, try this.[...]
Thank you very much.
I have got an idea on how the service applet works.
I run a simple script in bootlocal.sh:
#! /bin/sh
# $Id: setopenssh 477 2012-11-14 08:28:20Z rmssvn $
[ -f /usr/local/etc/init.d/openssh ] && {
sed '/case $1 in/ a\
status) pidof sshd;;' /usr/local/etc/init.d/openssh > /tmp/tmpopenssh
chmod 755 /tmp/tmpopenssh
mv -f /tmp/tmpopenssh /usr/local/etc/init.d/openssh
/usr/local/etc/init.d/openssh start
}
exit