Unfortunately no one can be told what fun_plug is - you have to see it for yourself.
You are not logged in.
Whenever I try to run any software on the Debian Etch I have installed, I get a "pty_allocate" error all the time.
I get a similar error if I try to access using SSH when there is already a Telnet. So it is a kind of one-user system and Debian isn't able to expand itself to run other software (like scp) ?
Anyone know what this can be caused by? Wrong in my startup script?
When I run the startup script below (busybox3 chroot /mnt/HD_a2/etch /etc/init.d/linuxrc), I get this error, maybe it is related?
Starting system log daemon: syslogd. Starting kernel log daemon: klogd. /etc/init.d/linuxrc: line 8: /etc/init.d/devfsd: No such file or directory Starting OpenBSD Secure Shell server: sshd. /etc/init.d/linuxrc: line 25: /etc/init.d/inetd: No such file or directory /etc/init.d/linuxrc: line 31: /etc/init.d/atd: No such file or directory Starting periodic command scheduler: crond. Usage: stop-bootlogd {start|stop|restart|force-reload}
Startup script
#!/bin/bash #SYSLOG /etc/init.d/sysklogd start /etc/init.d/klogd start # DEVFS /etc/init.d/devfsd start # SSH cd /dev MAKEDEV ptyp /etc/init.d/ssh start # NFS #/etc/init.d/portmap start #/etc/init.d/nfs-common start #/etc/init.d/nfs-user-server start # INETD /etc/init.d/inetd start # Makedev /etc/init.d/makedev start # CRON /etc/init.d/atd start /etc/init.d/cron start # Remove no login /etc/init.d/rmnologin stop # STOP BOOTLOG /etc/init.d/stop-bootlogd
Offline
Maybe this helps:
http://dns323.kood.org/forum/p1686-2007 … html#p1686
Offline
Are your sugggestion to recompile?
I tried the /dev/random thing, but didn't seem to have any effect. What can be the reason to why /etc/init.d/devfsd is missing?
Offline
bareare wrote:
Are your sugggestion to recompile?
No, I was suggesting to try this in your chroot:
mknod -m 0666 /dev/ptmx c 5 2 mkdir /dev/pts mount -t devpts devpts /dev/pts
Anyway, your linuxrc output looks real damaged. Have you tried to chroot manually (see some other thread a few days ago)?
Also, why do you start devfsd if it isn't installed? Why isn't it installed? Same with inetd and atd?
Offline
The linux rc script is from the wiki (http://dns323.kood.org/howto:chroot_debian:linuxrc). I have commented out the things I know don't work.
I have chrooted manually, then the system works for a while.
I'm considering starting completely from scratch again, erasing system and getting Debian Etch with SSH up and running. Several of the commands in wiki gave errors during initial install, maybe because it was made for Sarge(?).
Anyhow: Do you have some tips on how to do this clean install, including getting the latest busybox and software that works with this box. First time, I just found busybox in some thread, and a little information here and there. To have a detailed instructions on this would be nice I just need ssh and Debian Etch up and working..
I'll start with trying to follow the wiki again, maybe I get more lucky this time
Fonz.. do you reccomend starting with your fun_plug for Debian, or is Wiki instructions best for my use? Also, your site seems down..
Last edited by bareare (2007-07-10 00:33:01)
Offline
Try this fun_plug script below for Debian etch. It's a combination of a couple scripts I picked up here and it works on 1.03 (sorry I don't have time to find the other author!). I added on to fonz's fun_plug script in order to have busybox and telnet available in case I botch something up. I commented out the ptx & external usb, and time adjustment is now done with ntpd in the debian chroot.
#!/bin/sh VOL1=/mnt/HD_a2 VOL2=/mnt/HD_b2 FUNPLUGTAR=${VOL1}/fun_plug.tar FUNPLUGDIR=${VOL1}/fun_plug.d ETCDIR=${FUNPLUGDIR}/etc BINDIR=${FUNPLUGDIR}/bin LOGDIR=${FUNPLUGDIR}/log LOGFILE=${LOGDIR}/fun_plug.log PATH=${BINDIR}:${PATH} export VOL1 export VOL2 export FUNPLUGDIR export ETCDIR export BINDIR export LOGDIR export LOGFILE export PATH umask 022 mkdir -p ${FUNPLUGDIR} ${LOGDIR} echo "**** fun_plug script for DNS-323 (2007.04.03 tp@fonz.de) ****" >>${LOGFILE} date >>${LOGFILE} if [ -r "${FUNPLUGTAR}" ]; then echo "* Extracting ${FUNPLUGTAR}..." >>${LOGFILE} /bin/tar -xv -f ${FUNPLUGTAR} -C ${FUNPLUGDIR} 1>>${LOGFILE} 2>&1 echo "* Deleting ${FUNPLUGTAR}..." >>${LOGFILE} rm -f ${FUNPLUGTAR} fi if [ -d "${FUNPLUGDIR}/start" ]; then for fun_plug_script in ${FUNPLUGDIR}/start/*.sh; do if [ -x "${fun_plug_script}" ]; then echo "* Running ${fun_plug_script}..." >>${LOGFILE} ${fun_plug_script} 1>>${LOGFILE} 2>&1 else echo "* ${fun_plug_script} not executable..." >>${LOGFILE} fi done else echo "* ${FUNPLUGDIR}/start: Directory not found" fi echo "* Debian Chroot" >>${LOGFILE} VOL1=/mnt/HD_a2 VOL2=/mnt/HD_b2 etch=$VOL1/etch busybox=$VOL1/fun_plug.d/bin/busybox #modules=$VOL2/modules # Correct time issues #$busybox/adjtimex -t 9968 #$busybox/echo | $busybox/crontab - #$busybox/echo WET0WEST,M3.5.0/01,M10.5.0/02 > /etc/TZ # Load usb-storage #$busybox/insmod $modules/usb-storage.ko # Create /dev/random $busybox mknod /dev/random c 1 8 # Correct dev permissions $busybox chmod a+w /dev/tty $busybox chmod a+w /dev/full $busybox chmod a+w /dev/null $busybox chmod a+w /dev/zero $busybox chmod a+w /dev/random $busybox chmod a+w /dev/urandom # Setup pseudo-terminals #$busybox mkdir -p /dev/pts #$busybox mount -t devpts devpts /dev/pts #$busybox mknod -m 0666 /dev/ptmx c 5 2 # Start telnet #$busybox telnetd -l $busybox/sh # Bind mount VOL1 $busybox mkdir -p $etch/$VOL1 $busybox mount --bind $VOL1 $etch/$VOL1 # Bind mount VOL2 $busybox mkdir -p $etch/$VOL2 $busybox mount --bind $VOL2 $etch/$VOL2 # Bind mount dev $busybox mkdir -p $etch/dev $busybox mkdir -p $etch/dev/pts $busybox mount --bind /dev $etch/dev $busybox mount --bind /dev/pts $etch/dev/pts # Bind mount sys $busybox mkdir -p $etch/sys $busybox mount --bind /sys $etch/sys # Bind mount proc $busybox mkdir -p $etch/proc $busybox mount --bind /proc $etch/proc # Tmpfs mount /tmp /var/tmp /var/log /var/run /var/lock $busybox mount -t tmpfs tmpfs $etch/tmp $busybox mount -t tmpfs tmpfs $etch/var/tmp $busybox mount -t tmpfs tmpfs $etch/var/log $busybox mount -t tmpfs tmpfs $etch/var/run $busybox mount -t tmpfs tmpfs $etch/var/lock # Create mtab, fstab $busybox ln -sf /proc/mounts $etch/etc/mtab $busybox echo -n > $etch/etc/fstab # Set hostname $busybox hostname nas $busybox hostname > $etch/etc/hostname # Copy hosts, resolv.conf $busybox cp -f /etc/hosts $etch/etc/hosts $busybox cp -f /etc/resolv.conf $etch/etc/resolv.conf # Chroot into Debian $busybox chroot $etch /etc/init.d/rc 2 > /dev/null 2>&1 echo "* Debian Chroot Done" >>${LOGFILE}
Last edited by xenyz (2007-07-10 08:49:47)
Offline
Ok, I vent for the fonz fun plug to start with. But I do not have to mutch luck yet. I copied fun_plug and fun_plug.tar into /Volume_1 folder and rebooted. No action. The folders(files are chmod 777. It seems like several folders should have been created, but they are not.
I have only one voumne (running raid), but could that be the cause? I planned to get that original fun plug from fonz installed before I modified it more, but this wasn't to promising I'm running 1.03 firmware.
Last edited by bareare (2007-07-10 18:54:29)
Offline
No, it was created by default after the format of the disk.
First, I copied through a Windows share and rebooted. When that didn't work (no folders created and no telnet), I deleted the two files.
Then, I logged in with ftp and uploaded the files ito the Volumne folder again. Permissions was 777 for both files and the Volume_1 folder.
The user I logged in with ftp was Anonymous, but with root access. Could that make a permission problem maybe?
Last edited by bareare (2007-07-11 03:03:06)
Offline
For some reason, I got it to work now. The only thing different is that I pasted the fun_plug into a new document named fun_plug and uploaded it, instead of uploading it from the zip
Starting telnetd...
* /mnt/HD_a2/fun_plug.d/start/unfsd.sh not executable...
* Done
* Debian Chroot
* Debian Chroot Done
How can I get into a shell where I can run apt-get, install ssh server etc. like a normal Linux box?
Last edited by bareare (2007-07-11 05:02:04)
Offline
bareare wrote:
For some reason, I got it to work now. The only thing different is that I pasted the fun_plug into a new document named fun_plug and uploaded it, instead of uploading it from the zip
Starting telnetd...
* /mnt/HD_a2/fun_plug.d/start/unfsd.sh not executable...
* Done
* Debian Chroot
* Debian Chroot Done
How can I get into a shell where I can run apt-get, install ssh server etc. like a normal Linux box?
Go in through telnet and type # chroot /mnt/HD_a2/etch /bin/bash and it should give you a root shell. From there, root@nas:/# apt-get update ; apt-get install ssh
After that is finished, you should be able to reboot the NAS, have it run the script and start up sshd on the NAS. Remember to create another user under Debian, or set a root password first to log in.
(I should have taken better notes as I was doing this. If the above works, maybe it should be added to the Wiki for an 'easier' Debian etch install?)
Offline
It seems to work ok (apt-update works).
When I run apt-get install ssh, I get that many files that do exists (grep exists, but the openssh-client.postins does not)
Setting up openssh-client (4.3p2-9) ... /var/lib/dpkg/info/openssh-client.postinst: line 21: /mnt/HD_a2/fun_plug.d/bin/grep: No such file or directory
I did only extract the tar into Volume/etch directory. But then some permissions maybe becomes wrong?
Yes, it would be nice to have it as part of the wiki. It was far simlier to follow this than the one in the wiki now.
Last edited by bareare (2007-07-11 17:58:47)
Offline
It's not the permissions. It's this one:
xenyz wrote:
# chroot /mnt/HD_a2/etch /bin/bash
Should be:
# chroot /mnt/HD_a2/etch /bin/bash -ls
(it's dash small-L small-S) This way, you should get a clean environment. After the chroot, check
echo $PATH
It must not contain any fun_plug-stuff.
Offline
Rebooted and tried that now, then i got this:
BusyBox v1.5.0 (2007-05-06 16:42:17 CEST) Built-in shell (ash) Enter 'help' for a list of built-in commands. / # chroot /mnt/HD_a2/etch /bin/bash -ls bash: /mnt/HD_a2/fun_plug.d/bin/id: No such file or directory bash: [: : integer expression expected
I did however get into the box even thow the error occured, typing "echo $PATH" gave me /usr/local/bin:/usr/bin:/bin:/usr/games.
Extracting templates from packages: 100% Preconfiguring packages ... dpkg: `ldconfig' not found on PATH. dpkg: `start-stop-daemon' not found on PATH. dpkg: `install-info' not found on PATH. dpkg: `update-rc.d' not found on PATH. dpkg: 4 expected program(s) not found on PATH. NB: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin.
Last edited by bareare (2007-07-11 18:43:11)
Offline
There's still something wrong with the environment - and it looks similar to Emacs' problems (http://dns323.kood.org/forum/t688-Debia … nuxrc.html)
Instead of bash, he uses sh:
chroot /mnt/HD_a2/etch /bin/sh -l
Maybe that one works better...
Offline
Strange.. Got the same error
sh: /mnt/HD_a2/fun_plug.d/bin/id: No such file or directory
sh: [: : integer expression expected
I did a complete wipeout (format) again just to be sure it was not a random issue.
1. Uploaded fun_plug and funplug-0.2.tar and restarted: Telnet up and running, log ok. 2. Uploaded etch.tar. Extracted into /mnt/hd_a2/ and now etch is up in /mnt/hd_a2/etch. 3. Edited the funplug to include the Debian related stuff. 4. Log reports everything OK. 5. Running chroot /mnt/HD_a2/etch /bin/bash -ls 6. Getting this: "bash: /mnt/HD_a2/fun_plug.d/bin/id: No such file or directory. bash: [: : integer expression expected" 7. root@Boksen:/#
Last edited by bareare (2007-07-11 21:20:20)
Offline
I added all these to path, and then it worked At least, apt-get etc. works nicely. I'm sure I get some other problem But hopes it does it..
/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/sbin:/sbin:/usr/local/sbin
Offline
100% success
ssh is starting automatically on boot and everything, after adding /etc/init.d/ssh start to /etc/init.d/rc.
This should definitly be written some place.
Last edited by bareare (2007-07-11 21:50:10)
Offline
bareare wrote:
100% success
ssh is starting automatically on boot and everything, after adding /etc/init.d/ssh start to /etc/init.d/rc.
This should definitly be written some place.
For now, are you able to rename this thread's topic to something easier to locate?
Offline
fonz wrote:
It's not the permissions. It's this one:
xenyz wrote:
# chroot /mnt/HD_a2/etch /bin/bash
Should be:
Code:
# chroot /mnt/HD_a2/etch /bin/bash -ls(it's dash small-L small-S) This way, you should get a clean environment. After the chroot, check
Code:
echo $PATHIt must not contain any fun_plug-stuff.
For the record, if I follow the /bin/bash -ls I get the same error, even though it still goes to the bash prompt.
From telnet:
/ # chroot /mnt/HD_a2/etch /bin/bash -ls bash: /mnt/HD_a2/fun_plug.d/bin/id: No such file or directory bash: [: : integer expression expected root@nas:/# echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/games root@nas:/# exit logout / # chroot /mnt/HD_a2/etch /bin/bash root@nas:/# echo $PATH /mnt/HD_a2/fun_plug.d/bin:/usr/bin:/bin:/usr/sbin:/sbin
From sshd inside the Debian chroot:
computer:~ xenyz$ ssh nas xenyz@nas's password: xenyz@nas:~$ echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/games xenyz@nas:~$ su - Password: nas:~# echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin nas:~#
Offline