Opened 2 years ago

Closed 12 months ago

#2527 closed defect (fixed)

mapguide init script use log_daemon_msg and log_end_msg which are not defined in Centos 6

Reported by: gabrimonfa Owned by:
Priority: low Milestone:
Component: General Version:
Severity: trivial Keywords:
Cc: External ID:

Description

Mapguide 3.0.0 centos 6 64bit.

AFAIK log_daemon_msg and log_end_msg are not defined in Centos 6 even if lsb package is installed.

A possible solution would be to define them at the beginning of mapguide script, so they are eventually overwritten by sourcing /lib/lsb/init-functions

Attachments (1)

mapguide (1.5 KB) - added by gabrimonfa 13 months ago.
In this version I've tried to purge the script from "bashisms", to make it runnable under dash

Download all attachments as: .zip

Change History (5)

comment:1 Changed 2 years ago by jng

This is the service control script in its current form:

http://trac.osgeo.org/mapguide/browser/trunk/MgDev/Server/src/Core/mapguidectl

What changes could you suggest that would allow this script to work seamlessly on both CentOS and Ubuntu?

comment:2 Changed 2 years ago by gabrimonfa

I'm not really an expert on the topic.

"log_daemon_msg" may be replaced with a simple "echo -n" (as in other init scripts).

"log_end_message" gives different results in debian/ubuntu whether the argument is 0 or greater than 0 and usually is used with the exit code of a previous command. If called with 0 it shows a success message, otherwise a failure message.

However in our script it is always called with 0 as argument, so it may be replaced by "log_success_msg" which is supported on both ubuntu and centos.

comment:3 Changed 13 months ago by gabrimonfa

The proposed file try to address the following problems:

  • define log_end_msg if not defined in lsb functions (as in Centos 6)
  • define status and restart actions
  • exit with failures if something goes wrong
  • warn user if trying to start MapGuide and it is already running
  • warn user if trying to stop MapGuide and it is not running

I've not tested it throughly in Ubuntu

Changed 13 months ago by gabrimonfa

Attachment: mapguide added

In this version I've tried to purge the script from "bashisms", to make it runnable under dash

comment:4 Changed 12 months ago by jng

Resolution: fixed
Status: newclosed

Fixed trunk (r8969), 3.1 (r8970) and 3.0 (r8971).

Thanks for the patch.

Note: See TracTickets for help on using tickets.