Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a proper Linux service via RPM installation #1164

Closed
krugster opened this issue Sep 23, 2015 · 4 comments
Closed

Implement a proper Linux service via RPM installation #1164

krugster opened this issue Sep 23, 2015 · 4 comments

Comments

@krugster
Copy link

At the moment we have a separate script that needs to be run to turn the Sync Gateway into a service but it has been rather error-prone and also doesn't seem to follow normal linux conventions of using init scripts and service registration.

It would be much more desirable to have the RPM/deb and even Windows installation paths handle this automatically for the user much as it does for the Couchbase Server installations.

@ajres
Copy link
Contributor

ajres commented Sep 23, 2015

This looks like a duplicate of #1022

The sync_gateway_service_install.sh script does install init scripts and service registration for each platform, FYI following is code block that does that.

#Install the service for the specific platform
case $OS in
    Ubuntu)
        case $OS_MAJOR_VERSION in
            12|14)
                setup_output_dirs
                render_template script_templates/upstart_ubuntu_sync_gateway.tpl > /etc/init/${SERVICE_NAME}.conf
                service ${SERVICE_NAME} start
                ;;
            *)
                echo "ERROR: Unsupported Ubuntu Version \"$VER\""
                usage
                exit 1
                ;;
        esac
        ;;
    RedHat|CentOS)
        case $OS_MAJOR_VERSION in
            6)
                setup_output_dirs
                render_template script_templates/upstart_redhat_sync_gateway.tpl > /etc/init/${SERVICE_NAME}.conf
                initctl start ${SERVICE_NAME}
                ;;
            7)
                setup_output_dirs
                render_template script_templates/systemd_sync_gateway.tpl > /usr/lib/systemd/system/${SERVICE_NAME}.service
                systemctl enable ${SERVICE_NAME}
                systemctl start ${SERVICE_NAME}
                ;;
            *)
                echo "ERROR: Unsupported RedHat/CentOS Version \"$VER\""
                usage
                exit 1
                ;;
        esac
        ;;
    Darwin)
        setup_output_dirs
        render_template script_templates/com.couchbase.mobile.sync_gateway.plist > /Library/LaunchDaemons/com.couchbase.mobile.sync_gateway.plist
        launchctl load /Library/LaunchDaemons/com.couchbase.mobile.sync_gateway.plist
        ;;
    *)
        echo "ERROR: unknown OS \"$OS\""
        usage
        exit 1
        ;;
esac

@krugster
Copy link
Author

Apologies for the duplication Andy. Is that code block that you referenced already in SG as of 1.1.1 or is it something that will be coming in 1.2?

@zgramana
Copy link
Contributor

Closing as a duplicate of #1022.

@ajres
Copy link
Contributor

ajres commented Sep 23, 2015

That code block is in the 1.1.1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants