То, как установить двоичный файл на init на начальной загрузке как Apache, делает (работайте как услуга),

сначала удостоверьтесь, что у Вас есть пользователь кэш-памяти

id memcached

у Вас есть ошибка в Вашей конфигурации.. похож на DOS разрывы строки.. Выполните следующую команду по кэш-памяти sysconfig сценарий

dos2unix /etc/sysconfig/memcached
2
задан 14 June 2013 в 23:24
2 ответа

Since PhantomJS isn't going to provide any support to run daemons out of the box, you should take care of your service by yourself. It's great that you have found /etc/init.d/skeleton and used it to create an init script. What you describe shows that your process isn't going into background and this can be fixed by means of some wrapper. This can be start-stop-daemon which is specific to debian-based distributions, or a separate daemon package that can redirect stdin/stdout and handle additional situations.

Since I'm almost sure you use traditional way of writing init script, I suspect you may just add --background to your start-stop-daemon command.

When you're done fixing your script, check you have it owned by root:root with permissions 0755 (e.g. rwxr-xr-x). After this, update sysvinit symlinks with the update-rc.d command provided by Michael Hampton in his answer.

Just as a note, There are some other tools that support sending process to background and may be useful in other cases. For example, supervisor, upstart and systemd support this. Please refer to their documentation to get exact syntax. If you're going to use one of these, writing full init script is not necessary.

Sure thing, init scripts is the oldest and the most supported way of starting daemons.

1
ответ дан 3 December 2019 в 11:47

Если сценарий инициализации уже существует и правильно написан, его должно быть достаточно, чтобы включить его, как любой другой сценарий инициализации:

update-rc.d phantomjs defaults

или (12.04 +)

update-rc.d phantomjs enable

(Обычно это делается по умолчанию, когда вы устанавливаете пакеты с apt-get и его кузены ...)

1
ответ дан 3 December 2019 в 11:47

Теги

Похожие вопросы