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:
  • Like
Reactions: ozmule

Dave Gray

Guru
Joined
May 22, 2013
Messages
147
Reaction score
57
Location
Florida USA
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
15,401
Reaction score
2,730
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
Location
Buderim Qld, Australia
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
Location
Buderim Qld, Australia
@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
Location
Buderim Qld, Australia
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.
 
  • Like
Reactions: Stan-O

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
Location
Buderim Qld, Australia
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
 
  • Like
Reactions: wardmundy

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
15,401
Reaction score
2,730
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.
 

Members online

PIAF 5 - Powered by 3CX

Forum statistics

Threads
22,560
Messages
138,866
Members
14,669
Latest member
cleron