Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.4.1 available

The official documentation can be found on http://wiki.ocsinventory-ng.org. Read it before asking your question.

Release 2.4: Possible bug in setup.sh

Hi!

I've just updated my OCS Inventory NG Unix servers from version 2.3.1 to version 2.4. I've got one Communications Server and one Administration Server.

The installation of the Administration Server has raised the following error:

Writing Administration server configuration to file /etc/apache2/conf-available/ocsinventory-reports.conf
chown: cannot access '/etc/ocsinventory-server/plugins': No such file or directory
chown: cannot access '/etc/ocsinventory-server/perl': No such file or directory
*** ERROR: Unable to write /etc/apache2/conf-available/ocsinventory-reports.conf, please look at error in /root/OCSNG/OCSNG_UNIX_SERVER_2.4/ocs_server_setup.log and fix !

Installation aborted !

These messages, specially 'chown' ones -Isn't /ect/ocsinventory-server directory really part of the Communications Server configuration?-, and the fact that the file /etc/apache2/conf-available/ocsinventory-reports.conf was actually created successfully; led me to inspect the setup.sh script. And it seems that the problem is in these lines:

1853                 echo "Writing Administration server configuration to file $APACHE_CONFIG_DIRECTORY/$ADM_SERVER_APACHE_CONF_FILE"
1854                 echo "Writing communication server configuration to file $APACHE_CONFIG_DIRECTORY/$ADM_SERVER_APACHE_CONF_FILE" >> $SETUP_LOG
1855                 cp -f $ADM_SERVER_APACHE_CONF_FILE.local $APACHE_CONFIG_DIRECTORY/$ADM_SERVER_APACHE_CONF_FILE >> $SETUP_LOG 2>&1
1856
1857                 #Fix permissions on server side for plugin engine (perl / plugins) dir usually in etc/ocsinventory-server..
1858                 # Where are located OCS Communication server plugins configuration files
1859                 chown -R $APACHE_USER:$APACHE_GROUPE $OCS_COM_SRV_PLUGINS_CONFIG_DIR
1860                 # Where are located OCS Communication server plugins perl files
1861                 chown -R $APACHE_USER:$APACHE_GROUPE $OCS_COM_SRV_PLUGINS_PERL_DIR
1862                 if [ $? -ne 0 ]
1863                         then
1864                                 echo "*** ERROR: Unable to write $APACHE_CONFIG_DIRECTORY/$ADM_SERVER_APACHE_CONF_FILE, please look at error in $SETUP_LOG and fix !"
1865                                 echo
1866                                 echo "Installation aborted !"
1867                                 exit 1
1868                 fi

Line 1853 is right, but line 1854 mentions the Communications server, not the Administration server. Maybe the code for the Communications server has been reused here!

But the really offending lines are, IMHO, 1857 to 1861: Why is the script fixing the permissions of two directories of the Communications Server here? In my case they don't even exist!

Then, lines 1862 to 1868, which are intended to test that the Administration server configuration file has been created, fail. They should be placed immediately after line 1855, which is the one supposed to by tested.

Are lines 1857 to 1861 necessary and misplaced? Must Communications server plugins config and perl directories belong to www-data user?

Thanks in advance.

Kind regards.
asked in OCS Inventory NG server for Unix by (140 points)

Please log in or register to answer this question.

 
Powered by Question2Answer
...