# Single-user jail



## borisman (Jun 18, 2013)

Hello all. 

I want to upgrade my freebsd FreeBSD installation in a jail environment using beadm as described here: http://forums.freebsd.org/showthread.php?t=31662

So far so good, I have an upgrade jail mounted at new boot environment. Problem is that all services are started up in that jail (sshd/Samba/mpd5/whatever). The official upgrade guide for freebsd FreeBSD (http://www.freebsd.org/doc/handbook/makeworld.html) says that upgrades better be done from single-user mode with no services running.

I want to have a jail with no services running without having to modify rc.conf (otherwise there is a risk that after I switch to the upgraded environment I will forget to return changes back).

So far I tried to modify jail_<jailname>_ exec_start, but anything other than default "/bin/sh /etc/rc" results in jail not being started up.

I'm using ezjail, but it does not have to matter much since _the_ question is regarding the base jail functionality.


----------



## kpa (Jun 18, 2013)

It's safe to update the world parts of jails without actually starting them or using the single user mode. You can for instance update the world part of a jail at /some/path/myjail by doing this:

`make installworld DESTDIR=/some/path/myjail`

And then run mergemaster on the updated jail:

`mergemaster -Ui -D /some/path/myjail`.

This should work exactly like this to delete the old files, if it doesn't report back:

`make delete-old delete-old-libs DESTDIR=/some/path/myjail`


----------



## SirDice (Jun 19, 2013)

borisman said:
			
		

> The official upgrade guide for FreeBSD (http://www.freebsd.org/doc/handbook/makeworld.html) says that upgrades better be done from single-user mode with no services running.


For the past decade or so I've upgraded all my systems while everything was still running. Never had any issues. It's good advice but there's nothing stopping you from not following it. You just need to be aware there's always a possibility your system might get hosed.


----------



## borisman (Jul 8, 2013)

Thanks everyone!

The solution with upgrading world without even starting the jail works like charm!


----------

