By: Burt Silverman user 28 Jun 2018 at 3:47 p.m. CDT

4 Responses
Burt Silverman gravatar
I found this function in setup.py: ``` def insertLinesInFile(self, inFilePath, index, text): inFilePathLines = None try: f = open(inFilePath, "r") inFilePathLines = f.readlines() f.close() except: self.logIt("Error reading %s" % inFilePathLines, True) self.logIt(traceback.format_exc(), True) try: self.backupFile(inFilePath) inFilePathLines.insert(index, text) ... ``` The second try should not be part of the except. Now I found that this mistake leads to many errors in the setup.log, but it does not prevent the installation from succeeding. Despite the success, it is no fun looking at errors in the log and thinking they might be the cause of a real problem. Here is another way I scribbled some notes about the problem: For my Debian case, the setup.py script shows this: ``` # Make the generated script LSB compliant lsb_str="""#### BEGIN INIT INFO # Provides: opendj # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start daemon at boot time # Description: Enable service provided by daemon. ### END INIT INFO""" self.insertLinesInFile("/etc/init.d/opendj", 1, lsb_str) ``` but those lines were not getting inserted into the `/etc/init.d/opendj` file. I was seeing lots of errors in the setup.log, even though the script gets to the end and reports good and the install is successful. I fixed the indentation of that function, and I modified the above to ``` lsb_str="""### BEGIN INIT INFO # Provides: opendj # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start daemon at boot time # Description: Enable service provided by daemon. ### END INIT INFO """ ``` (small changes to match other files under `/etc/init.d`) and I was able to get rid of the related complaints in `setup.log`.

By Ganesh Dutt Sharma Account Admin 29 Jun 2018 at 12:18 a.m. CDT

Ganesh Dutt Sharma gravatar
Hi Burt, Thanks for bringing the code error in our notice. Probably during update, spaces got reset. We'll take care ASAP. Thanks again. --- Thanks Ganesh

By Burt Silverman user 29 Jun 2018 at 6:51 a.m. CDT

Burt Silverman gravatar
Thanks, Ganesh. Note that the small changes I recommended to the header of /etc/init.d/opendj are to change #### to ### near the top and add a couple of newlines at the bottom. Those are in addition to the python spacing fix.

By Devrim Yatar staff 01 Jul 2018 at 4:28 p.m. CDT

Devrim Yatar gravatar
Hi Burt, Thanks for your contribution. I fixed indentation error. See on github: [https://github.com/GluuFederation/community-edition-setup/blob/cee49d4476fad01b813939aa7f9eb56d38c61531/setup.py#L881](https://github.com/GluuFederation/community-edition-setup/blob/cee49d4476fad01b813939aa7f9eb56d38c61531/setup.py#L881) Most probably, fixed version of setup.py will be included in the next release.

By Devrim Yatar staff 01 Jul 2018 at 4:35 p.m. CDT

Devrim Yatar gravatar
I also applied your suggestion to `/etc/init.d/opendj` Regards.