View previous topic :: View next topic |
Author |
Message |
kangal Guru
Joined: 25 Jun 2005 Posts: 362 Location: Paris
|
Posted: Sun Jul 31, 2005 12:40 pm Post subject: [fichiers de conf] fichiers corrompus... |
|
|
Salut a tous!!
Voila, j'ai par accident un peu pourris mon /etc/conf.d/rc, par consequent j'ai enormement de warning au boot concernant le checkroot et le checkfs et de plus, je ne peux plus faire de sshd start:
root:/home/kangal >> /etc/init.d/sshd start
* Starting eth0
* Bringing up eth0
* dhcp
* Running dhcpcd ... [ !! ]
* ERROR: Problem starting needed services.
* "sshd" was not started.
ma question est assez generique: Comment faire pour recuperer un fichier si ce dernier a ete corrompu/effacer???
Merci beaucoup de votre aide:wink: _________________ SNK 4 Ever |
|
Back to top |
|
|
kopp Advocate
Joined: 09 Apr 2004 Posts: 2885 Location: Grenoble, France
|
Posted: Sun Jul 31, 2005 1:01 pm Post subject: |
|
|
Pour le sshd, tu reemerges ssh
pour le rc, tu reemerge baselayout (enfin, me semble) |
|
Back to top |
|
|
El_Goretto Moderator
Joined: 29 May 2004 Posts: 3171 Location: Paris
|
Posted: Sun Jul 31, 2005 1:11 pm Post subject: |
|
|
kopp wrote: | Pour le sshd, tu reemerges ssh
pour le rc, tu reemerge baselayout (enfin, me semble) |
C'est normal que sshd ne démarre pas si aucune interface réseau n'est présente. Il n'y a "que" baselayout à réinstaller (mais attention au miyard de fichiers de conf à manipuler derrière avec etc-update). |
|
Back to top |
|
|
kangal Guru
Joined: 25 Jun 2005 Posts: 362 Location: Paris
|
Posted: Sun Jul 31, 2005 1:20 pm Post subject: |
|
|
C'est bizare, j'ai remerger baselayout:
root:~ >> etc-update
Scanning Configuration files...
Exiting: Nothing left to do; exiting.
et quand je lance sshd
* Starting eth0
* Bringing up eth0
* dhcp
* Running dhcpcd ... [ !! ]
* ERROR: Problem starting needed services.
* "sshd" was not started.
Surtout que ma carte ethernet est eth1 et pas eth0... _________________ SNK 4 Ever |
|
Back to top |
|
|
kopp Advocate
Joined: 09 Apr 2004 Posts: 2885 Location: Grenoble, France
|
Posted: Sun Jul 31, 2005 1:44 pm Post subject: |
|
|
Qu'est ce qu'il y a dans ton fichier /etc/conf.d/net ? |
|
Back to top |
|
|
kangal Guru
Joined: 25 Jun 2005 Posts: 362 Location: Paris
|
Posted: Sun Jul 31, 2005 2:18 pm Post subject: |
|
|
root:/home/kangal >> cat /etc/conf.d/net
# /etc/conf.d/net:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $
# Global config file for net.* rc-scripts
# This is basically the ifconfig argument without the ifconfig $iface
#
iface_eth1="dhcp"
#iface_eth0="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"
# For DHCP set iface_eth? to "dhcp"
# For passing options to dhcpcd use dhcpcd_eth?
#
# For adding aliases to a interface
#
#alias_eth0="192.168.0.3 192.168.0.4"
# NB: The next is only used for aliases.
#
# To add a custom netmask/broadcast address to created aliases,
# uncomment and change accordingly. Leave commented to assign
# defaults for that interface.
#
#broadcast_eth0="192.168.0.255 192.168.0.255"
#netmask_eth0="255.255.255.0 255.255.255.0"
# For setting the default gateway
#
#gateway="eth0/192.168.0.1"
Mais j'ai l'impression que mon probleme viens de mon /sbin/rc...
root:/home/kangal >> /sbin/rc
/etc/init.d/domainname: line 12: syntax error: unexpected end of file
* ERROR: "/etc/init.d/domainname" has syntax errors in it; not executing...
* Starting eth0
* Bringing up eth0
* Configuration not set for eth0 - assuming dhcp
* dhcp
* Running dhcpcd ... [ !! ]
* ERROR: Problem starting needed services.
* "netmount" was not started.
* ERROR: Problem starting needed services.
* "sshd" was not started.
Au boot, j'ai des messages d'erreur a propo de mon /sbin/rc... _________________ SNK 4 Ever |
|
Back to top |
|
|
El_Goretto Moderator
Joined: 29 May 2004 Posts: 3171 Location: Paris
|
Posted: Sun Jul 31, 2005 2:52 pm Post subject: |
|
|
J'ai eu une fois aussi des boulettes de ce genre parce que j'avais introduit une faute de syntaxe dans rc.conf je crois. Enfin , à toi de passer tes fichiers de conf en revue, avec la coloration syntaxique gentoo de vim pour t'aider à voir ce qui peut coincer.
Après, je vois pas. |
|
Back to top |
|
|
ghoti Advocate
Joined: 30 Dec 2002 Posts: 3634 Location: Belgium
|
Posted: Sun Jul 31, 2005 3:14 pm Post subject: |
|
|
kangal wrote: | Surtout que ma carte ethernet est eth1 et pas eth0... |
Ton problème ressemble furieusement à celui-ci ... |
|
Back to top |
|
|
kangal Guru
Joined: 25 Jun 2005 Posts: 362 Location: Paris
|
Posted: Mon Aug 01, 2005 5:20 am Post subject: |
|
|
non parce que eth1 et eth0 ne se melange pas...C'est defini comme ca: eth0=firewire, eth1=ethernet
kangal:~ >> cat /etc/conf.d/net
# /etc/conf.d/net:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $
# Global config file for net.* rc-scripts
# This is basically the ifconfig argument without the ifconfig $iface
#
iface_eth1="dhcp"
#iface_eth0="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"
# For DHCP set iface_eth? to "dhcp"
# For passing options to dhcpcd use dhcpcd_eth?
#
# For adding aliases to a interface
#
#alias_eth0="192.168.0.3 192.168.0.4"
# NB: The next is only used for aliases.
#
# To add a custom netmask/broadcast address to created aliases,
# uncomment and change accordingly. Leave commented to assign
# defaults for that interface.
#
#broadcast_eth0="192.168.0.255 192.168.0.255"
#netmask_eth0="255.255.255.0 255.255.255.0"
# For setting the default gateway
#
#gateway="eth0/192.168.0.1"
Et c'est tres bizare parce que quand ma gentoo boot, internet ne marche pas alors je fais un dhcpcd eth1 et ca me donne ca:
root:/home/kangal >> dhcpcd eth1
**** dhcpcd: already running
**** dhcpcd: if not then delete /var/run/dhcpcd-eth1.pid file
et je suis obliger d'effacer le fichier et de refaire un dhcpcd eth1 pour que ca marche...
Et puis comment dire a sshd de ne pas demarrer eth0???
root:~ >> /etc/init.d/sshd start
* Starting eth0
* Bringing up eth0
* Configuration not set for eth0 - assuming dhcp
* dhcp
* Running dhcpcd ... [ !! ]
* ERROR: Problem starting needed services.
* "sshd" was not started.
root:~ >> _________________ SNK 4 Ever |
|
Back to top |
|
|
kangal Guru
Joined: 25 Jun 2005 Posts: 362 Location: Paris
|
Posted: Tue Aug 02, 2005 4:39 am Post subject: |
|
|
En fait mon principal probleme viens de mon /sbin/rc, j'ai cette erreur qui reviens regulierement:
Start command not found, a la ligne 416...Voici la ligne en question:
start || eerror "failed to start /etc/inid.d/$(service)"
Au boot il y a donc plein de truc qu'il ne peut pas lancer:( _________________ SNK 4 Ever |
|
Back to top |
|
|
kangal Guru
Joined: 25 Jun 2005 Posts: 362 Location: Paris
|
Posted: Tue Aug 02, 2005 6:31 pm Post subject: |
|
|
Personne n'as d'idee sur ce qui peut causer ce probleme??? _________________ SNK 4 Ever |
|
Back to top |
|
|
ghoti Advocate
Joined: 30 Dec 2002 Posts: 3634 Location: Belgium
|
Posted: Tue Aug 02, 2005 6:46 pm Post subject: |
|
|
kangal wrote: | En fait mon principal probleme viens de mon /sbin/rc, j'ai cette erreur qui reviens regulierement:
Start command not found, a la ligne 416...Voici la ligne en question:
start || eerror "failed to start /etc/inid.d/$(service)"
Au boot il y a donc plein de truc qu'il ne peut pas lancer:( |
En fait, les fonctions "start()" sont définies dans les différents services à lancer et sont "sourcées" à la ligne 410 du script /sbin/rc :
Quote: | start_critical_service() {
(
local retval=
local service=$1
# Needed for some addons like dm-crypt that starts in critical services
local myservice=$1
source "/etc/init.d/${service}" || eerror "Failed to source /etc/init.d/${service}" <== ligne 410
retval=$?
[ "${retval}" -ne 0 ] && return "${retval}"
[ -e "/etc/conf.d/${service}" ] && source "/etc/conf.d/${service}"
source /etc/rc.conf
start || eerror "Failed to start /etc/init.d/${service}" <== ligne 416
retval=$?
return "${retval}"
)
} |
Les problèmes proviendraient donc plutôt des scripts /etc/init.d/* eux-mêmes.
Pourrais-tu lister le code d'un de ces scripts qui foirent ? |
|
Back to top |
|
|
kangal Guru
Joined: 25 Jun 2005 Posts: 362 Location: Paris
|
Posted: Tue Aug 02, 2005 7:03 pm Post subject: |
|
|
Je ne comprend pas alors la commande start suivi du double pipe, elle est cence faire quoi???
enfin bref, voici certain de mes script qui deconne:
mon clock, mais je croit que c'est parce qu'il est incomplet:
root:/home/kangal >> cat /etc/init.d/clock
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
opts="save"
depend() {
need localmount
}
setupopts() {
if is_uml_sys ; then
TBLURB="UML"
fakeit=1
elif is_vserver_sys ; then
TBLURB="VServer"
fakeit=1
elif is_xenU_sys ; then
TBLURB="xen"
fakeit=1
elif grep -q ' cobd$' /proc/devices ; then
TBLURB="coLinux"
fakeit=1
elif [[ ${CLOCK} == "UTC" ]] ; then
myopts="--utc"
TBLURB="UTC"
else
myopts="--localtime"
TBLURB="Local Time"
fi
[[ ${fakeit} -eq 1 ]] && return 0
if [[ ${readonly} == "yes" ]] ; then
myadj="--noadjfile"
else
myadj="--adjust"
fi
if [[ ${SRM} == "yes" ]] ; then
myopts="${myopts} --srm"
fi
if [[ ${ARC} == "arc" ]] ; then
myopts="${myopts} --arc"
fi
myopts="${myopts} ${CLOCK_OPTS}"
# Make sure user isn't using rc.conf anymore.
if grep -qs ^CLOCK= /etc/rc.conf ; then
ewarn "CLOCK should not be set in /etc/rc.conf but in /etc/conf.d/clock"
fi
}
start() {
local myopts=""
local myadj=""
local TBLURB="" fakeit=0
local errstr=""
le fichier checkroot ne marhe pas non plus, ainsi que le checkfs mais ils sont vide!!! je ne sais pas quoi mettre dedans...
Je crois que le hostname ne passe pas non plus:
root:/home/kangal >> cat /etc/init.d/hostname
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
depend() {
need checkroot
}
start() {
local myhost=$(/bin/hostname 2>/dev/null)
local retval=0
# If the hostname is already set via the kernel, and /etc/hostname
# isn't setup, then we shouldn't go reseting the configuration #38172.
if [[ -z ${myhost} ]] || [[ ${myhost} == "(none)" ]] ; then
myhost="localhost"
fi
if [[ -f /etc/hostname ]] ; then
ewarn "You should stop using /etc/hostname and use /etc/conf.d/hostname"
myhost=$(</etc/hostname)
else
myhost=${HOSTNAME}
fi
ebegin "Setting hostname to ${myhost}"
/bin/hostname "${myhost}"
retval=$?
eend ${retval} "Failed to set the hostname"
if [[ ${retval} -eq 0 ]] ; then
# setup $HOSTNAME, ignore errors in case /etc is readonly.
echo "HOSTNAME=\"${myhost}\"" 2>/dev/null > /etc/env.d/01hostname
fi
return ${retval}
}
# vim:ts=4
Et le plus chiant, le ssh qui ne marche pas (tu peux voir mon message d'erreur plus haut...)
root:/home/kangal >> cat /etc/init.d/sshd
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/files/sshd.rc6,v 1.14 2005/04/20 02:08:38 vapier Exp $
depend() {
use logger dns
need net
}
checkconfig() {
if [ ! -d /var/empty ] ; then
mkdir -p /var/empty || return 1
fi
if [ ! -e /etc/ssh/sshd_config ] ; then
eerror "You need an /etc/ssh/sshd_config file to run sshd"
eerror "There is a sample file in /usr/share/doc/openssh"
return 1
fi
gen_keys
}
gen_keys() {
if [ ! -e /etc/ssh/ssh_host_key ] ; then
einfo "Generating Hostkey..."
/usr/bin/ssh-keygen -t rsa1 -b 1024 -f /etc/ssh/ssh_host_key -N ''
fi
if [ ! -e /etc/ssh/ssh_host_dsa_key ] ; then
einfo "Generating DSA-Hostkey..."
/usr/bin/ssh-keygen -d -f /etc/ssh/ssh_host_dsa_key -N ''
fi
if [ ! -e /etc/ssh/ssh_host_rsa_key ] ; then
einfo "Generating RSA-Hostkey..."
/usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
fi
}
start() {
checkconfig || return 1
ebegin "Starting sshd"
/usr/sbin/sshd
eend $?
}
stop() {
ebegin "Stopping sshd"
start-stop-daemon --stop --quiet --pidfile /var/run/sshd.pid
eend $?
}
Merci de ton aide:( _________________ SNK 4 Ever |
|
Back to top |
|
|
ghoti Advocate
Joined: 30 Dec 2002 Posts: 3634 Location: Belgium
|
Posted: Tue Aug 02, 2005 7:51 pm Post subject: |
|
|
kangal wrote: | Je ne comprend pas alors la commande start suivi du double pipe, elle est cence faire quoi??? |
C'est un chaînage de commandes : la commande à droite du "||" n'est exécutée que si le return code de la commande de gauche est différent de 0.
Un rc différent de 0 signifie en général "erreur" et le but du double pipe est alors d'afficher le message d'erreur idoine.
Mais ici, la commande "start" n'est pas trouvée, donc pas de return code (voir ci-après).
Quote: | enfin bref, voici certain de mes script qui deconne:
mon clock, mais je croit que c'est parce qu'il est incomplet: |
Si ton copier/coller est correct alors, en effet, le script est pourri. En particulier, la fonction start n'est pas complète, donc pas définie, ce qui bien sûr provoque un "start not found" et termine le script.
Quote: | le fichier checkroot ne marhe pas non plus, ainsi que le checkfs mais ils sont vide!!! je ne sais pas quoi mettre dedans...
Je crois que le hostname ne passe pas non plus: |
Le hostname ne passe pas parce qu'il a besoin de checkroot :
Quote: | depend() {
need checkroot
} |
Quote: | Et le plus chiant, le ssh qui ne marche pas (tu peux voir mon message d'erreur plus haut...) |
Là, c'est parce qu'il a besoin que le réseau soit fonctionnel, ce qui n'est pas le cas puisque le démarrage de ton dhcpd a planté!
Bref, j'ai l'impression que ton dernier "emerge baselayout" a complètement foiré
Refais une tentative et dis quoi ... |
|
Back to top |
|
|
kangal Guru
Joined: 25 Jun 2005 Posts: 362 Location: Paris
|
Posted: Tue Aug 02, 2005 8:43 pm Post subject: |
|
|
Le probleme c'est que quand j'essaye de le reemerger, il me dit qu'il est deja a jour et du coup ne fais rien
Je sais vraiment pas comment resoudre mon probleme... _________________ SNK 4 Ever |
|
Back to top |
|
|
boozo Advocate
Joined: 01 Jul 2004 Posts: 3193
|
|
Back to top |
|
|
kangal Guru
Joined: 25 Jun 2005 Posts: 362 Location: Paris
|
Posted: Tue Aug 02, 2005 9:03 pm Post subject: |
|
|
l'emerge marche mais par contre:
root:/home/kangal >> etc-update
Scanning Configuration files...
Exiting: Nothing left to do; exiting.
Donc en gros il remplace pas les fichiers
Dommage, car ca semble etre la solution... _________________ SNK 4 Ever |
|
Back to top |
|
|
boozo Advocate
Joined: 01 Jul 2004 Posts: 3193
|
|
Back to top |
|
|
kangal Guru
Joined: 25 Jun 2005 Posts: 362 Location: Paris
|
Posted: Tue Aug 02, 2005 9:38 pm Post subject: |
|
|
sys-apps/baselayout-1.11.13
Je vais essayer de refaire chacun des fichiers...Mais je pourrait pas les effacer, re-emerger baselayout et faire un etc-update???la au moin il trouverait des fichiers a modifier non??? _________________ SNK 4 Ever |
|
Back to top |
|
|
boozo Advocate
Joined: 01 Jul 2004 Posts: 3193
|
|
Back to top |
|
|
kangal Guru
Joined: 25 Jun 2005 Posts: 362 Location: Paris
|
Posted: Wed Aug 03, 2005 7:28 pm Post subject: |
|
|
ALors, j'ai resolu plein de mes problemes en effacant les fichiers en question et en les reemergeant:
seul 2 probleme subistent:
J'ai effacer mon /etc/init.d/sshd, quand je veux emerger ssh pour pouvoir le remplacer. j'ai ca:
root:/home/kangal >> emerge ssh
Calculating dependencies ...done!
!!! Error: the net-misc/openssh package conflicts with another package.
!!! both can't be installed on the same system together.
!!! Please use 'emerge --pretend' to determine blockers.
Je ne sais pas si je doit donc unmerger openssh ou et emerger ssh apres ou pas:(
Mon autre probleme viens d'internet, puisque j'ai un message d'erreur:
starting eth0
bringing up eth0 (ma carte est eth1...)
configuration not set for eth0 - assuming dhcpcd
dhcpcd
running dhcpcd
error :probleme starting needed device
netmount was not started
Apres ca quand je boote, je suis obliger de faire un rm /var/run/dhcpcd-eth1.pid file
puis un dhcpcd eth1 pour avoir une connection...
merci de votre aide! _________________ SNK 4 Ever |
|
Back to top |
|
|
boozo Advocate
Joined: 01 Jul 2004 Posts: 3193
|
|
Back to top |
|
|
Dais l33t
Joined: 05 Aug 2004 Posts: 977 Location: Québec
|
Posted: Wed Aug 03, 2005 7:35 pm Post subject: |
|
|
Pour le ssh, garde openssh, tout simplement. Tu peux utiliser le ssh comme d'habitude. _________________ Tout ce que je suis n'est que cause
Tout ce que je suis n'est que conséquence
Pourquoi s'attacher à toutes ces choses
Pourquoi continuer dans la souffrance ?
-
Shiki Soku Ze Ku, Ku Soku Ze Shiki |
|
Back to top |
|
|
kangal Guru
Joined: 25 Jun 2005 Posts: 362 Location: Paris
|
Posted: Wed Aug 03, 2005 7:47 pm Post subject: |
|
|
g reemerger openssh, j'ai donc de nouveau mon sshd mais:
root:/home/kangal >> /etc/init.d/sshd start
* Caching service dependencies ... [ ok ]
* Starting eth0
* Bringing up eth0
* Configuration not set for eth0 - assuming dhcp
* dhcp
* Running dhcpcd ... [ !! ]
* ERROR: Problem starting needed services.
* "sshd" was not started. _________________ SNK 4 Ever |
|
Back to top |
|
|
boozo Advocate
Joined: 01 Jul 2004 Posts: 3193
|
|
Back to top |
|
|
|