Ubuntu Suomen keskustelualueet
Muut alueet => Muut käyttöjärjestelmät ja Linux-jakelut => Aiheen aloitti: kamara - 07.08.12 - klo:15.06
-
Mulla pyörii sshd Raspberry Pi:ssä, muttei se käynnisty automaattisesti koneen käynnistämisen yhteydessä.
Mihinkä pitää laittaa sen käynnistymisscripti.
#/etc/init.d/ssh restart
-
Löysin ohjelman sysv-rc-conf, jolla pystyneen laittaa palveluja käynnistymään, mutta mille kaikille tasoille kannattaa laittaa?
Kone toimii siis tekstipohjaisena serverinä.
-
Ei taida toimia ihan niin kuin haluaisin. :'(
-
Löytyi ainakin jonkinlainen purkkaratkaisu.
Muutin /etc/rc.local:n seuraavanlaiseksi:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# But locally (for BCM 2835 ARM Linux) we...
_firstboot=false
# assume there is no /etc/hostip until we have run at least once
if [ ! -f /etc/hostip ]; then
# once-off initialization
echo "Welcome to Raspberry Pi - one-off initialization"
[ -x /sbin/ldconfig ] && /sbin/ldconfig
[ -x /sbin/insserv ] && /sbin/insserv networking 2>/dev/null
_firstboot=true
fi
if [ -x /boot/boot.rc ]; then
# note the user could easily try to make or edit this file in Windows
# this will give it the wrong line endings and may result in errors
# we try to discourage this my not making it a .txt file
. /boot/boot.rc
fi
# show the main IP address late enough in the start-up sequence for people
# to read it e.g. to be able to ssh to the system
if hostname -I > /etc/hostip; then
_IP=`cat /etc/hostip`
[ -z "$_IP" ] || echo "My network IP address is $_IP"
/etc/init.d/ssh start
fi
if ${_firstboot}; then
# Experience suggests that we are in a mess on the first boot
# (Something (ifplugd?) prevents the loopback network interface comming up)
echo "Raspberry Pi rebooting... "
echo "-- If we stop waiting for portmap feel free to turn the power off"
echo " and on again"
echo "-- (only on this reboot occasion - it is normally better to wait)"
echo "see you later."
reboot
fi
exit 0
Eli lisäsin siihen yhden rivin:
/etc/init.d/ssh start
-
En nyt menisi noita muuttelemaan.... Muistaakseni noi demonit Debian starttaisi automaattisesti. Jos ei kokeile update-rc.d tai dpkg-reconfigure ssh. /etc/rc.local ei ole paikka systeemin demoneille. Ei ole nyt Debinia käsillä, enkä muista sen ajotasoja. Gentoossa homma hoituu rc-update komennolla. Ks. man update-rc.d. Mitkä palvelut käynnistyy bootissa hallitaan ihan kometorivillä ei init scriptejä muokkaamalla jotka päivityksen yhteydessä taas muokkautuvat.
-
Kunhan paketti openssh-server on asennettu sshd käynnistyy itsestään bootissa.