# Jails aren't starting applications automatically.



## folivora (Jun 15, 2011)

Hi.

Recently I upgraded from RELEASE-8.1 to RELEASE-8.2. I upgraded the host OS and all the jails. I did rebuild World again for all the Jails and so on.

After I did put the Jails online, I noticed that none of the applications which I have in Jails' /etc/rc.conf won't start. I did not have this problem before upgrading. I have searched the logfiles and the internet, but I haven't found any information about this problem.

I can start some Jail service by adding the jail_jail1_exec_start command in the host OS'es /etc/rc.conf, but for me this isn't good solution.

All help is respected.

- folivora


----------



## SirDice (Jun 15, 2011)

Please post the relevant bits from your host's /etc/rc.conf.


----------



## folivora (Jun 15, 2011)

Here is the host OS /etc/rc.conf


```
#JAIL
jail_enable="YES"
jail_list="jail_1"
jail_set_hostname_allow="NO"
jail_procfs_enable="NO"
```


```
#JAIL SECTION
#JAIL 1
jail_jail_1_rootdir="/usr/jail/jail_1"
jail_jail_1_hostname="jail_1"
jail_jail_1_interface="re0"
#jail_jail_1_exec_start="/usr/local/sbin/apachectl restart"
jail_jail_1_exec_start="/usr/sbin/sshd"
#jail_jail_1_exec_start="/usr/local/sbin/oidentd"
jail_jail_1_ip="xxx.xxx.81.4"
jail_jail_1_devfs_enable="YES"
jail_jail_1_devfs_ruleset="devfsrules_jail"
```

I have disabled those few lines, because sshd must start. Others can be started manually from the Jail, but it is not very useful.

- folivora


----------



## SirDice (Jun 15, 2011)

Remove all the *_exec_* entries. Start the services inside the jail using the 'normal' way, i.e. enabling them in /etc/rc.conf. Treat a jail like you would treat any normal stand-alone system.


----------



## folivora (Jun 15, 2011)

Thank you SirDice.

I removed all _exec_ entries. It seems that oidentd and pdnsd needed rc script. Should apache and  mysql have rc scripts?

I am asking this because, I am not sure about that could I be missing some rc scripts from my Jails?


----------



## SirDice (Jun 15, 2011)

folivora said:
			
		

> Should apache and  mysql have rc scripts?


Yes, they do. Have a look in /usr/local/etc/rc.d/ (in the jail of course  ).


----------



## folivora (Jun 15, 2011)

Yes I noticed this. 

rcorder lists contents of /usr/local/etc/rc.d/. 

But when I restart the jail from host OS none of the content of /usr/local/etc/rc.d/ isn't run.

I don't know if my upgrade of this has somehow failed.


----------



## SirDice (Jun 15, 2011)

The biggest question is, are those services enabled in the jail's /etc/rc.conf?


----------



## folivora (Jun 15, 2011)

Yes the command are enabled in jail's /etc/rc.conf. This problem did appear after upgrading to RELEASE-8.2.

I have rebuild and installed world to Jails. Problem continues still.

All scripts in /etc/rc.d/ are starting just fine. None of the scripts which are in /usr/local/etc/rc.d/ aren't started.

Any good way to find logs about this kind of error.

-folivora


----------



## fbsd1 (Jun 16, 2011)

I am running RELEASE-8.2 with 5 jails and have no problems. My though is you messed up the jail upgrade process some how. Suggest you use the sysutils/qjail port to create and manage your jails.


----------



## da1 (Jun 16, 2011)

folivora said:
			
		

> Any good way to find logs about this kind of error.



Inside the jail, add the following to /etc/syslog.conf

```
*.*                                             /var/log/all.log
```
then do:
[cmd=]touch /var/log/all.log[/cmd]
and "reboot" the jail. After that, login and check the all.log file for any errors.


----------



## SirDice (Jun 17, 2011)

da1 said:
			
		

> then do:
> [cmd=]touch /var/log/all.log[/cmd]
> and "reboot" the jail.


You can also just restart syslog:

```
service syslog restart
```


----------



## folivora (Jun 17, 2011)

Ok, I did add 
	
	



```
*.*                                             /var/log/all.log
```

to /etc/syslog.conf and then I did restart jail.

Here is everything from all.log


```
tail -f /var/log/all.log

Jun 17 12:15:51 jail_1 syslogd: restart
Jun 17 12:15:51 jail_1 syslogd: kernel boot file is /boot/kernel/kernel
Jun 17 12:15:51 jail_1 /usr/sbin/cron[53775]: (CRON) WARNING (madvise() failed)
Jun 17 12:15:57 jail_1 login: chflags(/dev/pts/9): No such file or directory
Jun 17 12:15:57 jail_1 login: chown(/dev/pts/9): No such file or directory
Jun 17 12:15:57 jail_1 login: login on pts/9 as root
```

-folivora


----------

