zapty / forever-service

Provision node script as a service via forever, allowing it to automatically start on boot, working across various Linux distros and OS
https://github.com/zapty/forever-service
MIT License
594 stars 65 forks source link

Support for Fedora Server 21 #29

Closed alexbbb closed 9 years ago

alexbbb commented 9 years ago

Hi and thank you for the excellent work! With the latest forever-service running on Fedora Server 21 32bit, I saw the following message

forever-service version 0.4.6

This platform is not yet supported by forever-service
To help us add this platform, please contibute to https://github.com/zapty/forever-service

Fedora Server uses Systemd, but in /etc/init.d/README is stated that:

Note that traditional init scripts continue to function on a systemd
system. An init script /etc/rc.d/init.d/foobar is implicitly mapped
into a service unit foobar.service during system initialization.

To test it, I've modified this line: https://github.com/zapty/forever-service/blob/master/templates/sysvinit/installer.js#L11 by adding |(Fedora):

if( contents && contents.match(/(Amazon Linux)|(Red Hat)|(CentOS)|(Fedora)/g) ){

and then when I ran forever-service again I was able to install the service and everything is working fine. I opened the issue to let you know that you can add Fedora to the list of supported systems.

arvind-agarwal commented 9 years ago

@alexbbb Thanks for testing this and pointing out, I will add Fedora support in next build.

stillagainst commented 9 years ago

I tried forever-service on an old test-machine and got this message of "not yet supported", too.

So I looked after my /etc/os-release file and there was no such file. Then I looked into /proc/version and it told me my distro and kernel version. And best of all, on a fedora machine it says that it is a Red Hat one.

Maybe you should check /proc/version instead of /etc/os-release, but I haven't tested this on other machines.

arvind-agarwal commented 9 years ago

@stillagainst which release of Fedora it is on your test server?

stillagainst commented 9 years ago

I don't have access to it right now, but it looked sth like this one: Linux version 2.6.32.12-115.fc12.i686 (mockbuild@x86-03.phx2.fedoraproject.org) (gcc version 4.4.3 20100127 (Red Hat 4.4.3-4) (GCC) )

Just found out that some CentOS behaves similar: Linux version 2.6.32-71.el6.x86_64 (mockbuild@c6b6.centos.org) (gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC) )

Edit: there is a file called /etc/issue , maybe that one helps, too.

arvind-agarwal commented 9 years ago

I have added code pointed by @alexbbb, could not test in earlier version of Fedora, closing this for now. If someone wants earlier version of Fedora to be supported, please open another issue with exact version and similar details.