Hangs after running the "pkg upgrade" command

akumanova68

Dabbler
Joined
Aug 5, 2019
Messages
12
Dear All,

I am new to freenas 11.2. I install the freenas under VMWare platform with all default options. Once the freenas successfully boot, I login as root and run the "pkg update" and "pkg upgrade -y" in order to update the system. (My target is to install openvpn and tomcat).

Unfortunately, freenas is unable to startup after a reboot and hangs in a process:

"Trying to mount root from zfs:freenas-boot/ROOT/default []...
middlewared: loaded plugin boot

If I wait for a long enough time, it continues but the system fails (unable to login through web interface)

May I know anybody can advise how to resolve this? Thanks.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
I am new to freenas 11.2. I install the freenas under VMWare platform with all default options. Once the freenas successfully boot, I login as root and run the "pkg update" and "pkg upgrade -y" in order to update the system. (My target is to install openvpn and tomcat).
FreeNAS, although it is based on FreeBSD, is a software appliance that is not intended to be modified in that way. You would need to install any additional packages inside jails, not directly into the FreeNAS system.
 

akumanova68

Dabbler
Joined
Aug 5, 2019
Messages
12
Dear Chris,

I am still in a learning path and thanks for your reply in advance. Since my first target is to install tomcat, and I try to use the command "pkg install openjdk8", and then "pkg install tomcat9".

These two commands are work only once, but after reboot, it seems that the JDK no more working.

From your last response, should I also install "openjdk" and "tomcat" inside "jail"? I find that some installations using the "pkg" command seems not working, or the config files are reset / removed.

If the "openjdk" or "tomcat" has to be installed under "jail", can you refer some document so that I can follow? Thank you very much.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
From your last response, should I also install "openjdk" and "tomcat" inside "jail"?
Not also, but instead.

Only install packages in jails.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703

akumanova68

Dabbler
Joined
Aug 5, 2019
Messages
12
Hi Sretalla,

Thanks for your reply. I read 14.4.1 and try to follow the way to install the package, e.g. "pkg install openjdk8", I can see the error message as follow:

[21/23] Upgrading mkfontscale from 1.1.2 to 1.2.1...
pkg: mkfontscale-1.2.1 conflicts with mkfontdir-1.0.7 (installs files into the same place). Problematic file: /usr/local/bin/mkfontdir

First of all, is this the correct approach to install openjdk8? Did you also successfully install any JDK? Thanks.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Have you run pkg update && pkg upgrade already first? (in the jail shell)
 

akumanova68

Dabbler
Joined
Aug 5, 2019
Messages
12
Hi Sretalla,

Super thanks for your help. I originally do not have the "jail" concept but now I know it, thanks for your remind.
I successfully install the openJDK as well as the tomcat and able to kick start under the jail.

I simply create the jail through GUI, and switch to the jail console to install the openJDK & tomcat.

After I install tomcat, I have a problem to kick start, and I eventually add a "vendor.conf" to run the "startup.sh" in order to make the tomcat start when the jail starts, and modify the rc.shutdown to shutdown the tomcat once the jail ends.

Although I am not sure whether the above is correct procedures, it works.

However I have a problem, I try to setup the network interface. I don't want to be DHCP and I hope to make it static IP.

My Freenas ip is 192.168.1.109, and I hope to make the tomcat to be 192.168.1.110.
I try to setup several parameters in the jail GUI as an enclosed picture:

VNET / Berkeley Packet Filter checkbox is checked.
IPv4 Interface = le0
IPv4 Address = 192.168.1.110
IPv4 Netmask = 24
IPv4 default Router = none

But I cannot make it work... I research on the internet for a day and no luck, any hints?

In addition, is it possible to use the same IP address (e.g. 192.168.1.109:8080) to connect to the tomcat? Any help would be appreciated, thank you very much.
 

Attachments

  • cap1.png
    cap1.png
    13.1 KB · Views: 321

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
You will need to set the default router to something or your jail won't get out of your network.

The screenshot seems to show you selected the bridge as the interface... this is normally set to em0 or igb0 (depends on your NIC driver).

Otherwise, your settings look OK.

I recommend avoiding the sharing of the FreeNAS GUI IP (you would need to not use VNET in that case) as it can cause problems that are difficult to diagnose.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I eventually add a "vendor.conf" to run the "startup.sh" in order to make the tomcat start when the jail starts, and modify the rc.shutdown to shutdown the tomcat once the jail ends.
You could probably search a bit and see if there's a service installed as part of the pkg, in which case you could probably use something like sysrc tomcat_enable="YES" and then service tomcat start. services set to enabled automatically start with the jail and are gracefully stopped on jail stop.
 

akumanova68

Dabbler
Joined
Aug 5, 2019
Messages
12
Hi Sretalla,

I follow your instruction and seems no luck.

I set the default router to either 192.168.1.1 (My physical router IP address) or 192.168.1.109 (Freenas IP address), I still cannot connect.

If I uncheck the VNET, the "IPv4 Default Router" field gray out, and I even cannot start the Jail.

May I know anything I miss? Thanks for your help.
 

akumanova68

Dabbler
Joined
Aug 5, 2019
Messages
12
For Sretella,

I also enclosed the setting for your reference, thank you very much.
 

Attachments

  • cap1.png
    cap1.png
    13.6 KB · Views: 252

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Under Jaill properties, check the option for allow_raw_sockets

If it still isn't working, post the putput from CLI on the host and in the jail from ifconfig
 
Last edited:

akumanova68

Dabbler
Joined
Aug 5, 2019
Messages
12
Hi Sretalla,

Thank you for your suggestion. I also tried the "allow_raw_sockets" property but no luck. I run the ifconfig command under the jail and enclosed, any hints? Thanks.
 

Attachments

  • cap1.png
    cap1.png
    46.2 KB · Views: 247

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
It's clear you are missing the epair in the jail. What about ifconfig on the host?
 

akumanova68

Dabbler
Joined
Aug 5, 2019
Messages
12
Hi Sretalla,

Thanks for your reply. I have no idea what the epair is. I also enclosed the ifconfig for the host, any hints? Thanks.
 

Attachments

  • cap.png
    cap.png
    71 KB · Views: 250

akumanova68

Dabbler
Joined
Aug 5, 2019
Messages
12
Hi Sretalla,

I also attach another two version of ifconfig.

Cap1.png shows the workable solution, which is using the DHCP. It contains epair interface

Cap2.png and Cap3.png shows the problematic settings, which is not using DHCP. It really does not contain the "epair" interface.

I have no idea is this "epair" interface is created by FreeBSD jail itself? Please advise and thanks.
 

Attachments

  • cap.png
    cap.png
    96.8 KB · Views: 239
  • cap2.png
    cap2.png
    850.4 KB · Views: 257
  • cap3.png
    cap3.png
    669.3 KB · Views: 242

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
The jail system creates the epair (when things are working properly).

I recall reading about some problem with static IPs and jails. Which exact version of 11.2 are you running?

Perhaps the best solution for now is to statically reserve an IP for your jail in DHCP. (that's how I've always done mine)

One more thing to try is using vnet0 as the interface instead of le0.
 
Last edited:

akumanova68

Dabbler
Joined
Aug 5, 2019
Messages
12
Hi Sretalla,

Thank you for your reply. I also try all possible choices such as vnet / bridge but no luck. I've already tried all possible configuration and I give up now.

The "Jail" concept makes the setting too complicated and lots of problems introduced which restricted Freenas to be popular and requires a super experienced person like you to configure rather than a newbie like me.

I find out that lots of problem for FreeNAS to act as a NAS server which would be an obstacle to replace my Synology with Freenas, very frustrated, but super thanks for your help.

I am not sure whether I should ask the question here but it is related to the tomcat setup... Is it possible to access the disk pool space that outside the jail when I am in the jail, i.e. after running the command "jexec <JailID> /bin/tcsh", I want to access the space outside the jail?

I try to add a mount point through the jail interface but it is quite problematic. For example, I make a mount point that points to somewhere outside the jail, the mount point can only access the "current directory level", if I enter the subdirectory level, I cannot see any files within the subdirectory level within the jail.

I test this in plex media also by mounting to a specific location and add media folder to the mount point, however, the plex software can see the files in the mount point level but not in subdirectories. I suspect that this is a permission problem, any advise? Thanks.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
What you're seeig with the mountpoints is a permissions problem.

Application permissions in jails are well documented and not really difficult. You need the user running the application in the jail to have the same UUID as the one having the permissions on the directory itself.
 
Top