Page 1 of 1

Jails won't start after power loss

Posted: 04 Apr 2014 16:28
by mrhanman
I have two jails, and neither will start after I lost power unexpectedly last night (Time for a UPS battery replacement). I've tried manually starting from the commandline, and I get this -

Code: Select all

nas4free: ~ # /etc/rc.d/jail start ownCloud
Configuring jails:.
Starting jails: cannot start jail "ownCloud": 
jail: exec /bin/sh: No such file or directory
jail: /bin/sh /etc/rc: failed
.
I tired reinstalling theBrig, but it didn't help. I can't find any error's in theBrig's logs, or anywhere else. I'm really not sure where to go from here.

Please help!

EDIT: I created a new, empty jail, and it starts fine. Comparing the two configs, I noticed that the ownCloud jail didn't have a jail start command. I copied the start command from my test jail to it, but it still won't start.

Re: Jails won't start after power loss

Posted: 11 Apr 2014 15:26
by mrhanman
Does anyone have any ideas? Maybe some logs I can look at?

Re: Jails won't start after power loss

Posted: 15 May 2014 23:16
by howi42
Same problem for me.
I get :

# /etc/rc.d/jail start owncloud Configuring jails:.
Starting jails: cannot start jail "owncloud":
jail: exec /bin/sh: Permission denied
jail: /bin/sh /etc/rc: failed

Not sure what is missing.

Re: Jails won't start after power loss

Posted: 16 May 2014 16:18
by howi42
Since nothing worked, I formatted the disk with TheBrig installation ans started over.
This is what I get :

fetch -o /tmp/thebrig_install.sh https://github.com/fsbruva/thebrig/raw/ ... install.sh
/tmp/thebrig_install.sh 100% of 4053 B 13 MBps 00m00s
howiserver: /tmp # chmod a+x /tmp/thebrig_install.sh
howiserver: /tmp # /bin/sh /tmp/thebrig_install.sh /mnt/jails/jails 2
Retrieving the testing branch as a zip file
working.zip 100% of 248 kB 479 kBps 00m01s
Unpacking the tarball...
x README
x conf/
x conf/bin/
x conf/bin/change_ver.php
x conf/bin/ftp_amd64
x conf/bin/ftp_i386
x conf/bin/jail.sh
x conf/bin/thebrig_fetch.sh
x conf/bin/thebrig_ports_cron.php
x conf/bin/thebrig_start.php
x conf/bin/thebrig_start.sh
x conf/bin/thebrig_stop.sh
x conf/bin/thebrig_update_cron.php
x conf/ext/
x conf/ext/thebrig/
x conf/ext/thebrig/extensions_thebrig.php
x conf/ext/thebrig/extensions_thebrig_check.php
x conf/ext/thebrig/extensions_thebrig_config.php
x conf/ext/thebrig/extensions_thebrig_download.php
x conf/ext/thebrig/extensions_thebrig_edit.php
x conf/ext/thebrig/extensions_thebrig_fstab.php
x conf/ext/thebrig/extensions_thebrig_log.php
x conf/ext/thebrig/extensions_thebrig_manager.php
x conf/ext/thebrig/extensions_thebrig_ports.php
x conf/ext/thebrig/extensions_thebrig_tarballs.php
x conf/ext/thebrig/extensions_thebrig_tools.php
x conf/ext/thebrig/extensions_thebrig_update.php
x conf/ext/thebrig/fstab.png
x conf/ext/thebrig/functions.inc
x conf/ext/thebrig/lang.inc
x conf/ext/thebrig/menu.inc
x conf/ext/thebrig/off_small.png
x conf/ext/thebrig/on_small.png
x conf/freebsd-update.conf
x conf/freebsd-update_thin.conf
x conf/make.conf
x conf/periodic.conf
x conf/portsnap.conf
x conf/sbin/
x conf/sbin/freebsd-update
x conf/sbin/portsnap
x thebrig_install.sh
No need updates
You use fresh version



After that the installation dir is empty ( besides a logfile telling me about a successful installation )

I am lost.

Re: Jails won't start after power loss

Posted: 16 May 2014 16:33
by dreamcat4
howi42 wrote:Since nothing worked, I formatted the disk with TheBrig installation ans started over.
After that the installation dir is empty ( besides a logfile telling me about a successful installation )
I am lost.
Hi howie42,
Perhaps "theBrig" isn't working anymore (i honestly don't know myself). You may go back to using theBrig in future if it gets fixed again later on.

But until then, you are welcome to try my tool: "Finch"

http://www.forums.nas4free.org/viewtopi ... =79&t=6260

They do not interfere or conflict with each other.

Re: Jails won't start after power loss

Posted: 16 May 2014 16:35
by raulfg3
now you need to download tarball for BSD.

go to tarball management: download/file.php?id=1815

and remember that you do install on /mnt/jails/jails not in /mnt/jails

Re: Jails won't start after power loss

Posted: 16 May 2014 18:19
by howi42
No, that is not possible. As I said, following the commands described above, the install dir is empty - no extension is loaded.
BTW, if I run the three install commands via the nas4free command option, I get the following error:

Parse error: syntax error, unexpected '<' in /bin/sh on line 90

Re: Jails won't start after power loss

Posted: 27 Aug 2014 15:23
by AustinPowersISU
Did anyone figure out what's going on with this error?

I can't upgrade form the initial version of theBrig to 0.8 because of this error. After the upgrade, my jails start/stop just fine, but after a nas reboot I get the exact same error about /bin/sh not being available.

I figure it must have something to do with my thin jails and the basejail not linking up correctly, as the bin directory is shared with the basejail. I have since reverted to a snapshot and restored my config back to the original version of theBrig.

Re: Jails won't start after power loss

Posted: 27 Aug 2014 15:42
by AustinPowersISU
In the original version of theBrig, I see this in my mounts:

/mnt/vault/jails/basejail on /mnt/vault/jails/lms/basejail (nullfs, local, read-only)

(and other similar entries, one for each jail)

I don't have 0.8 installed right now, but I don't think that was present when I was trying to start my jails. If that isn't getting mounted, that would explain why /bin/sh isn't accessible in the jail, as that's part of the basejail.

I wonder if there is something wrong when upgrading theBrig with thin jails.

Re: Jails won't start after power loss

Posted: 30 Oct 2014 19:54
by Upiter
UP :!:

I have the same problem as AustinPowersISU

Re: Jails won't start after power loss

Posted: 29 Dec 2014 22:56
by BodgeIT
This is now getting more common.
Can someone help?

I have brig 0.8 installed on Nas4Free 9.3.0.2.

Re: Jails won't start after power loss

Posted: 29 Dec 2014 23:12
by alexey123
For UFS I run fsck in case power lost. But without any background job - with umount and fsck -y.

For zfs...
Hmmm.. WTF snapshot on zfs tabs?

Re: Jails won't start after power loss

Posted: 30 Dec 2014 16:00
by BodgeIT
I've put my brig and jails on a ufs drive that is always on.
Not sure of the point of ZFS for running apps?

I noticedin another post that there is a comment about installing ports within the jail...does that apply here?

Re: Jails won't start after power loss

Posted: 31 Dec 2014 11:25
by BodgeIT
This issue is less to do with drive failure than a Brig that is not fully configured.

I've noticed that when I create my jail and configure it and then start, I can interact with it normally but when I add shares to my fstab and try and run mount -a, I get

Code: Select all

fstab: /etc/fstab:0: No such file or directory
I can see that the shares are being redirected but I know that jail will not start following a restart.

I also have this error in my Brig Log:

Code: Select all

 	TheBrig error!: 	/etc/rc.d/jail: ERROR: jail: /etc/fstab.plex does not exist
I can confirm that fstab.plex does exist in NAS4Free /etc/

Re: Jails won't start after power loss

Posted: 13 Jan 2015 18:33
by BodgeIT
I have now found that I can create jails and have them restart after a reboot so long as I use full jails as opposed to slim jails.

Something in the linkage for the slim jail content with the basejail messes up and prevents it from starting.