if statement for symlink of lighttpd.conf is wrong in cacti.postinst
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cacti (Ubuntu) |
Fix Released
|
Low
|
Paul Gevers |
Bug Description
When installing cacti on a system with lighttpd already installed, debian/
An excerpt of the code I believe to be at fault is here:
# Only try to add a symlink on a fresh install to respect
# changes done by the administrator
if [ "$2" = '' ]; then
for server in $webservers; do
if [ -d "/etc/$
if [ ! -e "/etc/$
ln -s ../../cacti/
fi
elif [ -d "/etc/$
if [ ! -e "/etc/$
ln -s ../../cacti/
fi
fi
done
fi
I've included the part about apache to show where in regards to the full statement that the web server is restarted.
I believe the correct behavior should be as follows:
if [ "$2" = '' ]; then
for server in $webservers; do
if [ -d "/etc/$
if [ ! -e "/etc/$
ln -s ../../cacti/
fi
elif [ -d "/etc/$
if [ ! -e "/etc/$
fi
fi
done
fi
My changes reflect the fact that:
- it needs to check if the file already exists rather than checking the directory
- I've changed the file name to reflect what I believe to be an appropriate interpretation of the naming convention for the debian take on conf files for lighttpd which is nn-name where nn reflects the priority number
- included a call to lighty-enable-mod to then enable the cacti conf file (as we are installing cacti aren't we?)
- shifted the call to invoke a http reboot to after lighttpd statements so that in both apache and lighttpd cases the daemon is restarted
There is also a problem with the lighttpd.conf file that is provided, it is as so:
# Cacti Alias
alias.url += (
"/cacti" => "usr/share/
)
it should be:
# Cacti Alias
alias.url += (
"/cacti" => "/usr/share/
)
to reflect that it is relative to the root directory rather than current.
description: | updated |
Changed in cacti (Ubuntu): | |
assignee: | nobody → Paul Gevers (paul-climbing) |
status: | New → Confirmed |
status: | Confirmed → Triaged |
importance: | Undecided → Low |
Hi,
Thanks for providing the patch. However, do you agree that the "invoke-rc.d $server reload || true" should be one line lower, i.e. after the "fi"? Now, in case of apache it does not get called.