Improved Adobe Media Server init scripts

Adobe Media Server (aka AMS, formerly Flash Media Server) is a popular media delivery tool, also suitable for interactive multiuser applications.

This set of patches fixes some obvious bugs in the original startup scripts:

The first problem is especially relevant if AMS is managed by a clustering software (e.g. heartbeat), as the resource manager can sometimes issue a service ams start for an already running process expecting no side effects.

The patches were derived from an Ubuntu intallation, but they are likely fit for other Linux distributions as well.

The instructions below assume that the AMS base directory is /opt/adobe/ams and the service init script is /etc/init.d/ams.

To install:

 tar xfz ams-init-patch.tgz
 cd /opt/adobe/ams
 patch -p1 < /path/to/server.diff
 patch -p1 < /path/to/adminserver.diff
 cd /etc/init.d
 patch -p1 < /path/to/ams.diff