SOLVED Ubuntu update problems after IncrediblePBX install

Stan-O

Member
Joined
Oct 9, 2013
Messages
60
Reaction score
8
I've been banging my head against the wall trying to get some Ubuntu updates installed and couldn't figure out why post-install scripts were failing (no error messages, the updates would just stall forever), so today I have finally diagnosed the problem.

The /sbin/status was no longer available on my system and instead the invoke-rc.d was calling the /usr/local/sbin/status installed by IncrediblePBX script. The invoke-rc.d is a script which is used by the various package install scripts to stop/start/restart services being updated/installed. Since it relies on the status binary to determine the run status of the service and it gets replaced by the IncrediblePBX install script, the invoke-rc.d calls were just stalled resulting in failed updates.

Solution (you need to run these as root on your IncrediblePBX machine):
Code:
mv /usr/local/sbin/status /usr/local/sbin/pbxstatus
sed -i 's|/usr/local/sbin/status|/usr/local/sbin/pbxstatus|' ~/.profile
apt-get --reinstall install upstart
 
Last edited:

Dave Gray

Guru
Joined
May 22, 2013
Messages
150
Reaction score
60
Umm, yeah, thats pretty much it. You should not have needed to get another copy of /sbin/status - the install doesn't touch it, just shadows it by putting it higher in the path.
The whole fuzzball of having /usr/local/anything on root's path, I will not get into here. 'Tis well that asterisk, apache and mysql don't run as root, but it's not so nice that all the maintenance stuff (and, the usual login) is root.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
For the record... we had a status app long before Ubuntu did. We plan to rename ours to pbx-status RSN.
 

Stan-O

Member
Joined
Oct 9, 2013
Messages
60
Reaction score
8
Well, I'm glad I could help diagnose the problem others were also facing. I'd still take IncrediblePBX on Ubuntu over CentOS setup, kudos to devs for making IncrediblePBX happen on Ubuntu.
 

ozmule

New Member
Joined
Sep 10, 2015
Messages
11
Reaction score
4
Sensational catch ....

So for a linux noob like me, can I just verify I have the steps correct, before I go breaking stuff again :(

Check version on both vm's to ensure they are the same version
Code:
cat /etc/*-release
Open Incredible PBX with winscp
Code:
cd /usr/local/sbin
cp status status.bak
cp status pbxstatus
rm -v status

Open other Ubuntu server of same version using winscp
Code:
copy /sbin/status locally to pc c:\temp\status

Open Incredible PBX server using winscp
Code:
copy c:\temp\status to /usr/local/sbin/status

All should be good again for apt-get update and apt-get upgrade?
 

Stan-O

Member
Joined
Oct 9, 2013
Messages
60
Reaction score
8
Assuming you're root on the IncrediblePBX machine you need to run:
Code:
mv /usr/local/sbin/status /usr/local/sbin/pbxstatus
apt-get --reinstall install upstart
sed -i 's|sbin/status|sbin/pbxstatus|' /root/.profile

That will rename the IncrediblePBX's binary and reinstall the Ubuntu one. I have tested this on my machine.

Depending on the status of your previous updates you may also want to run:
Code:
dpkg --configure -a
to finalize post-install setup of previously updated packages before you run apt-get/aptitude update.
 
Last edited by a moderator:

ozmule

New Member
Joined
Sep 10, 2015
Messages
11
Reaction score
4
@Stan-O thank you for your reply. Either I did something wrong or it didn't work as expected. :(

After reinstalling upstart I have a /sbin/status which is a link (or shortcut) to /sbin/initctl

There is no /usr/local/sbin/status and the following message after booting completes

-bash: /usr/local/sbin/status: No such file or directory

Also, should IncrediblePBX scripts be changed to use /usr/local/sbin/pbxstatus now?

Thanks again for the help.
 

ozmule

New Member
Joined
Sep 10, 2015
Messages
11
Reaction score
4
Well despite the message of
No such file or directory
everything is working well.

This fix is really quick and simple. Best done before you have the issue itself.

I did it several times and worked best when I restored a previous backup, did the fix then apt-get update/upgrade

Hat tip to @Stan-O - thank you for sharing and your subsequent replies to my questions. Appreciate it immensely.
 

Stan-O

Member
Joined
Oct 9, 2013
Messages
60
Reaction score
8
@Stan-O thank you for your reply. Either I did something wrong or it didn't work as expected. :(

There is no /usr/local/sbin/status and the following message after booting completes

-bash: /usr/local/sbin/status: No such file or directory
Oh, I'll need your help to fix that, I've edited my dot-files so they no longer call the pbxes status script.

If you do cat ~/.profile and cat /etc/profile -- do either of these try to call /usr/local/sbin/status? If I knew which one calls the old binary I could provide you with another one-liner command to fix it.
 

ozmule

New Member
Joined
Sep 10, 2015
Messages
11
Reaction score
4
Right, so the output for cat ~/.profile seems to be what you are looking for
Code:
# ~/.profile: executed by Bourne-compatible login shells.

if [ "$BASH" ]; then
  if [ -f ~/.bashrc ]; then
    . ~/.bashrc
  fi
fi

/root/update-IncrediblePBX && /usr/local/sbin/status && echo "Always run Incredible PBX behind a hardware-based firewall." && mesg n
 

Stan-O

Member
Joined
Oct 9, 2013
Messages
60
Reaction score
8
Great! The command below fixes that.
Code:
sed -i 's|/usr/local/sbin/status|/usr/local/sbin/pbxstatus|' ~/.profile
 

ozmule

New Member
Joined
Sep 10, 2015
Messages
11
Reaction score
4
Wow. Thanks that has resolved that one as well. :thumbsup:
Thanks again @Stan-O for your assistance. No way I would have found and fixed this on my own.
 

Stan-O

Member
Joined
Oct 9, 2013
Messages
60
Reaction score
8
Fantastic!

In a script I would have wrapped these commands in the if-statement:
Code:
if [ -f /usr/local/sbin/status ]; then
    mv /usr/local/sbin/status /usr/local/sbin/pbxstatus
    sed -i 's|/usr/local/sbin/status|/usr/local/sbin/pbxstatus|' ~/.profile
    apt-get --reinstall install upstart
fi
and I'm sure that's what you've done.

Again thanks for making IncrediblePBX happen on Ubuntu!
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
I've only reworked the original installer thus far so there will always be a /usr/local/sbin/status in place before the patch is applied... but, great idea.
 
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top