Reply
Emerging Member
Posts: 60
Registered: ‎01-01-2016
Kudos: 34
Solutions: 3

Re: Unifi Controller on Debian 9

In my case I was dealing with my homelab and had a VM snapshot ready to roll back to. I can't speak for anyone else, but I expect problems, plain and simple.
Emerging Member
Posts: 96
Registered: ‎12-17-2016
Kudos: 13
Solutions: 1

Re: Unifi Controller on Debian 9

For those on Ubuntu 16.04 (or other recent Debian-based systems) you can easily set grub to boot the .79 kernel (or another backup kernel) without uninstalling/reinstalling anything by editing /etc/default/grub:

 An even easier method is to use Grub Customizer and set .79 as the default.

pfSense on i5-4200U/8GB Qotom Mini PC | UniFi Switch 24 | UniFi Switch 8 | UAP-AC-M-PRO | UAP-AC-M (2) | TP-Link TL-SG108E | Synology DS718+ (UniFi Controller in Debian 9.6 VM)
New Member
Posts: 6
Registered: ‎05-24-2017
Kudos: 11

Re: Unifi Controller on Debian 9

Here is a much better fix than rolling back to an insecure kernel.

 

Run

sudo sed -i -e 's/^JSVC_EXTRA_OPTS=$/JSVC_EXTRA_OPTS="-Xss2m"/' /usr/lib/unifi/bin/unifi.init

 

 

Reboot and you're done. I Imagine Ubiquiti can roll the change out in an updated package soon.

New Member
Posts: 1
Registered: ‎06-20-2017

Re: Unifi Controller on Debian 9


@packets wrote:

Here is a much better fix than rolling back to an insecure kernel.

 

Run

sudo sed -i -e 's/^JSVC_EXTRA_OPTS=$/JSVC_EXTRA_OPTS="-Xss2m"/' /usr/lib/unifi/bin/unifi.init

 

 

Reboot and you're done. I Imagine Ubiquiti can roll the change out in an updated package soon.


I can confirm that doing this, then updating to kernel 3.16.43-2+deb8u1 does indeed work.  Thanks!

Member
Posts: 208
Registered: ‎06-15-2015
Kudos: 68
Solutions: 8

Re: Unifi Controller on Debian 9

[ Edited ]

@UBNT-MikeD wrote:

The problem appears to be triggered when running jsvc.


 

I've been running the Unifi controller without jsvc for a long time. I don't know what the need is to use jsvc with systemd. I've asked here before, and through my own research and experience, have not found any reason to run it. It takes extra resources and adds another layer of process management, which is unnecessary due to the functionality of systemd (and probably upstart and other modern init systems).

 

Edit: to be clear, I'm running the Unifi controller on Debian9 without jsvc

Member
Posts: 107
Registered: ‎02-03-2016
Kudos: 16

Re: Unifi Controller on Debian 9

Can you explain the options being added here? From my amateur read, this means you're setting the stack size to 2 MB by hand? What's the default size and how might this impact performance on memory constrained boxes?
New Member
Posts: 6
Registered: ‎05-24-2017
Kudos: 11

Re: Unifi Controller on Debian 9

Not everyone uses systemd. Only a small fraction of the machines I administer have it installed.

Supporting additional init systems creats more work. SysV scripts are almost universally supported.
New Member
Posts: 22
Registered: ‎03-12-2017
Kudos: 7

Re: Unifi Controller on Debian 9


@packets wrote:

Here is a much better fix than rolling back to an insecure kernel.

 

Run

sudo sed -i -e 's/^JSVC_EXTRA_OPTS=$/JSVC_EXTRA_OPTS="-Xss2m"/' /usr/lib/unifi/bin/unifi.init

 

 

Reboot and you're done. I Imagine Ubiquiti can roll the change out in an updated package soon.


Thanks packets, tried that but Unifi will not start.  On Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-79-generic x86_64)if that makes any difference.

New Member
Posts: 6
Registered: ‎05-24-2017
Kudos: 11

Re: Unifi Controller on Debian 9

[ Edited ]

Looks like you're using an old, insecure kernel. My fix works using 4.4.0-81-generic on Ubuntu 16.04.2 LTS.

 

The change the sed command does it modify the line SVC_EXTRA_OPTS= in the init.d script to JSVC_EXTRA_OPTS="-Xss2m"

Member
Posts: 208
Registered: ‎06-15-2015
Kudos: 68
Solutions: 8

Re: Unifi Controller on Debian 9


@packets wrote:
Not everyone uses systemd. 

Sure, but Debian9 (and Debian8) have systemd as the default init system. Ubuntu 16.04 and later have systemd as default. Those distributions are the targets for the Unifi controller deb packages, so it makes sense to me to use the default init system.

Ubiquiti Employee
Posts: 9,533
Registered: ‎01-28-2013
Kudos: 16719
Solutions: 608
Contributions: 20

Re: Unifi Controller on Debian 9

[ Edited ]

reamonn wrote: Thanks packets, tried that but Unifi will not start.  On Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-79-generic x86_64)if that makes any difference.

Weird. I was able to use this on 4.4.0-79-generic, and that server is now running 4.4.0-81-generic.

 

We're discussing this change internally. Thanks @packets!

 

Cheers,

Mike

New Member
Posts: 6
Registered: ‎05-24-2017
Kudos: 11

Re: Unifi Controller on Debian 9


@BetterHomeWifi wrote:

@packets wrote:
Not everyone uses systemd. 

Sure, but Debian9 (and Debian8) have systemd as the default init system. Ubuntu 16.04 and later have systemd as default. Those distributions are the targets for the Unifi controller deb packages, so it makes sense to me to use the default init system.


Fair enough :-)

New Member
Posts: 1
Registered: ‎07-23-2016
Kudos: 3

Re: Unifi Controller on Debian 9

[ Edited ]

@packets wrote:

Here is a much better fix than rolling back to an insecure kernel.

 

Run

sudo sed -i -e 's/^JSVC_EXTRA_OPTS=$/JSVC_EXTRA_OPTS="-Xss2m"/' /usr/lib/unifi/bin/unifi.init

Not a bad idea, but I would rather add this to /etc/default/unifi. This way, the chance for breaking something should be much smaller:

 

echo "JSVC_EXTRA_OPTS=\"\$JSVC_EXTRA_OPTS -Xss2m\"" >>/etc/default/unifi

 

Ubiquiti Employee
Posts: 4,012
Registered: ‎01-11-2016
Kudos: 1196
Solutions: 29

Re: Unifi Controller on Debian 9

We've found that only increasing the stack to 1280KB also works fine (-Xss1280k), which is only 20% higher stack consumption for 64-bit platforms (default is 1M for 64-bit, 320k for 32-bit). If this doesn't work for someone here, please let us know.
Want to try out new features or fixes before they're released as Stable? Sign up for Beta here: https://help.ubnt.com/hc/en-us/articles/204908664-How-To-Signup-for-Beta-Access
Having connectivity issues? See: https://help.ubnt.com/hc/en-us/articles/221029967-UniFi-Debugging-Intermittent-Connectivity-Issues-on-your-UAP
New Member
Posts: 6
Registered: ‎02-26-2017
Kudos: 1

Re: Unifi Controller on Debian 9

Great find! But how do i increase it? Or will some sort of patch roll out?
Ubiquiti Employee
Posts: 4,012
Registered: ‎01-11-2016
Kudos: 1196
Solutions: 29

Re: Unifi Controller on Debian 9

[ Edited ]

@NyLLoWLike this, as root:

echo "JSVC_EXTRA_OPTS=\"\$JSVC_EXTRA_OPTS -Xss1280k\"" >>/etc/default/unifi

 

It is actually a bug in the upstream kernel fix, and the fix (to the fix Man Happy ) is currently being tested in Debian unstable, so they will hopefully release it as stable ASAP.

Want to try out new features or fixes before they're released as Stable? Sign up for Beta here: https://help.ubnt.com/hc/en-us/articles/204908664-How-To-Signup-for-Beta-Access
Having connectivity issues? See: https://help.ubnt.com/hc/en-us/articles/221029967-UniFi-Debugging-Intermittent-Connectivity-Issues-on-your-UAP
New Member
Posts: 6
Registered: ‎05-24-2017
Kudos: 11

Re: Unifi Controller on Debian 9

May I suggest modifying the stickied thread?

 

Suggesting people pin an insecure kernel is a very bad idea, now that there's a functioning workaround. I wonder how many controllers will never get updated kernels now...

New Member
Posts: 6
Registered: ‎02-26-2017
Kudos: 1

Re: Unifi Controller on Debian 9

Thanks @packets and @UBNT-jeff Man Happy
Ubiquiti Employee
Posts: 4,012
Registered: ‎01-11-2016
Kudos: 1196
Solutions: 29

Re: Unifi Controller on Debian 9

@packets Yes, we will update it. Thanks!
Want to try out new features or fixes before they're released as Stable? Sign up for Beta here: https://help.ubnt.com/hc/en-us/articles/204908664-How-To-Signup-for-Beta-Access
Having connectivity issues? See: https://help.ubnt.com/hc/en-us/articles/221029967-UniFi-Debugging-Intermittent-Connectivity-Issues-on-your-UAP
New Member
Posts: 38
Registered: ‎06-23-2016
Kudos: 13
Solutions: 1

Re: Unifi Controller on Debian 9

[ Edited ]

@packets Thanks.  I've edited my post above to make sure people know how to revert the grub change once an updated kernel is released.

Reply