[0.9.5] systemctl check is triggered on post-install even though systemd is not in use
Hi,
I cannot find answer after google and check posts at github. influxdb 0.9.4.1 runs fine at my server (debian 7) and I want to upgrade to 0.9.5 for some bug fix. But I got error error like:
Operation failed: Invalid argument
dpkg: error processing influxdb (--install):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
influxdb
try again:
melson@gs1:/tmp$ sudo dpkg -i influxdb_0.9.5.1_amd64.deb
(Reading database ... 254321 files and directories currently installed.)
Preparing to replace influxdb 0.9.5.1 (using influxdb_0.9.5.1_amd64.deb) ...
mkdir: cannot create directory `/etc/influxdb': File exists
Unpacking replacement influxdb ...
Operation failed: Invalid argument
Setting up influxdb (0.9.5.1) ...
chmod: cannot operate on dangling symlink `/usr/bin/influxdb'
chmod: cannot operate on dangling symlink `/usr/bin/influxdb-benchmark'
chmod: cannot operate on dangling symlink `/usr/bin/influxdb-daemon'
Operation failed: Invalid argument
dpkg: error processing influxdb (--install):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
influxdb
remove and try again with commands:
sudo apt-get remove influxdb --purge
sudo dpkg -i influxdb_0.9.5.1_amd64.deb
But the same error:
Operation failed: Invalid argument
dpkg: error processing influxdb (--install):
subprocess installed post-installation script returned error exit status 1
It looks some install script issue but I do not know how to fix it. Appreciate for any suggestion.
Thanks.
After debugging, the error message comes from /var/lib/dpkg/info/influxdb.postinst
if which systemctl > /dev/null 2>&1 ; then
cp $SCRIPT_DIR/influxdb.service /lib/systemd/system/influxdb.service
systemctl enable influxdb
when it runs "systemctl enable influxdb", return error message "Operation failed: Invalid argument".
Fixed and provide my work for someone may need it.
It looks like systemctl does not work. Actually, my system has systemctl binary but we do not use it. We still count on sysV.
- To cheat influxdb.postinst, I move /bin/systemctl to /bin/systemctl-bak and run dpkg -i influxdb_0.9.5.1_amd64.deb again.
- copy influxdb.conf sample from github to /etc/influxdb/influxdb.conf.
- run "service influxdb start" and it is ready on port 8083 and 8086
- after installation succeed, restore systemctl-bak to systemctl
@melson-jao Thank you for posting your workaround. The post-installation script assumes that if you have systemctl installed then we should be using systemd, but I'll look into improving the logic around that check to not fail in cases like this.
Closing this as won't fix for now. The flagship Linux distributions are all moving to systemd, so trying to determine whether systemd is the currently-used init system seems like a waste of time. For anyone that runs into this issue, please use the workaround above.