Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-980

Add a service script or daemon mode in the distribution

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.2-incubating
    • Fix Version/s: 3.3.0
    • Component/s: server
    • Labels:

      Description

      Based on this discussion, it looks like there was an example from Daniel Kuppitz on how to create a gremlin server service on linux:
      https://groups.google.com/forum/#!msg/gremlin-users/uA48IQ3YJcw/4KnUKIS8HI4J

      Here is a link to the gist for the service:
      https://gist.github.com/dkuppitz/20bda51e3465a612cd9b

      I think it would be great to include this or a way to daemonize the server into the tinkerpop distribution.

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/tinkerpop/pull/439

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/tinkerpop/pull/439
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user dkuppitz commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          I can't test Systemd, but I've installed Gremlin Server as a service and that worked like a charm. Manual starts / restarts / stops /status requests worked as expected. Killing the process didn't lead to any unexpected behavior.

          Next I installed the service as a real system service (I may have overlooked it, but I believe this is not mentioned in the docs):

          ```
          daniel@cube ~ $ sudo update-rc.d -f gremlin-server defaults
          Adding system startup for /etc/init.d/gremlin-server ...
          /etc/rc0.d/K20gremlin-server -> ../init.d/gremlin-server
          /etc/rc1.d/K20gremlin-server -> ../init.d/gremlin-server
          /etc/rc6.d/K20gremlin-server -> ../init.d/gremlin-server
          /etc/rc2.d/S20gremlin-server -> ../init.d/gremlin-server
          /etc/rc3.d/S20gremlin-server -> ../init.d/gremlin-server
          /etc/rc4.d/S20gremlin-server -> ../init.d/gremlin-server
          /etc/rc5.d/S20gremlin-server -> ../init.d/gremlin-server
          daniel@cube ~ $ sudo update-rc.d -f gremlin-server enable
          update-rc.d: warning: start runlevel arguments (none) do not match gremlin-server Default-Start values (2 3 4 5)
          update-rc.d: warning: stop runlevel arguments (none) do not match gremlin-server Default-Stop values (0 1 6)
          Enabling system startup links for /etc/init.d/gremlin-server ...
          Removing any system startup links for /etc/init.d/gremlin-server ...
          /etc/rc0.d/K20gremlin-server
          /etc/rc1.d/K20gremlin-server
          /etc/rc2.d/S20gremlin-server
          /etc/rc3.d/S20gremlin-server
          /etc/rc4.d/S20gremlin-server
          /etc/rc5.d/S20gremlin-server
          /etc/rc6.d/K20gremlin-server
          Adding system startup for /etc/init.d/gremlin-server ...
          /etc/rc0.d/K20gremlin-server -> ../init.d/gremlin-server
          /etc/rc1.d/K20gremlin-server -> ../init.d/gremlin-server
          /etc/rc6.d/K20gremlin-server -> ../init.d/gremlin-server
          /etc/rc2.d/S20gremlin-server -> ../init.d/gremlin-server
          /etc/rc3.d/S20gremlin-server -> ../init.d/gremlin-server
          /etc/rc4.d/S20gremlin-server -> ../init.d/gremlin-server
          /etc/rc5.d/S20gremlin-server -> ../init.d/gremlin-server
          ```

          Then I rebooted my system and Gremlin Server started right away. Great! Finally I removed the system service:

          ```
          daniel@cube ~ $ sudo update-rc.d gremlin-server disable
          update-rc.d: warning: start runlevel arguments (none) do not match gremlin-server Default-Start values (2 3 4 5)
          update-rc.d: warning: stop runlevel arguments (none) do not match gremlin-server Default-Stop values (0 1 6)
          Disabling system startup links for /etc/init.d/gremlin-server ...
          Removing any system startup links for /etc/init.d/gremlin-server ...
          /etc/rc0.d/K20gremlin-server
          /etc/rc1.d/K20gremlin-server
          /etc/rc2.d/S20gremlin-server
          /etc/rc3.d/S20gremlin-server
          /etc/rc4.d/S20gremlin-server
          /etc/rc5.d/S20gremlin-server
          /etc/rc6.d/K20gremlin-server
          Adding system startup for /etc/init.d/gremlin-server ...
          /etc/rc0.d/K20gremlin-server -> ../init.d/gremlin-server
          /etc/rc1.d/K20gremlin-server -> ../init.d/gremlin-server
          /etc/rc6.d/K20gremlin-server -> ../init.d/gremlin-server
          /etc/rc2.d/K80gremlin-server -> ../init.d/gremlin-server
          /etc/rc3.d/K80gremlin-server -> ../init.d/gremlin-server
          /etc/rc4.d/K80gremlin-server -> ../init.d/gremlin-server
          /etc/rc5.d/K80gremlin-server -> ../init.d/gremlin-server
          daniel@cube ~ $ sudo update-rc.d -f gremlin-server remove
          Removing any system startup links for /etc/init.d/gremlin-server ...
          /etc/rc0.d/K20gremlin-server
          /etc/rc1.d/K20gremlin-server
          /etc/rc2.d/K80gremlin-server
          /etc/rc3.d/K80gremlin-server
          /etc/rc4.d/K80gremlin-server
          /etc/rc5.d/K80gremlin-server
          /etc/rc6.d/K20gremlin-server
          ```

          That's it. No surprises, everything's working well. Nothing to add here, except ...

          VOTE: +1

          Show
          githubbot ASF GitHub Bot added a comment - Github user dkuppitz commented on the issue: https://github.com/apache/tinkerpop/pull/439 I can't test Systemd, but I've installed Gremlin Server as a service and that worked like a charm. Manual starts / restarts / stops /status requests worked as expected. Killing the process didn't lead to any unexpected behavior. Next I installed the service as a real system service (I may have overlooked it, but I believe this is not mentioned in the docs): ``` daniel@cube ~ $ sudo update-rc.d -f gremlin-server defaults Adding system startup for /etc/init.d/gremlin-server ... /etc/rc0.d/K20gremlin-server -> ../init.d/gremlin-server /etc/rc1.d/K20gremlin-server -> ../init.d/gremlin-server /etc/rc6.d/K20gremlin-server -> ../init.d/gremlin-server /etc/rc2.d/S20gremlin-server -> ../init.d/gremlin-server /etc/rc3.d/S20gremlin-server -> ../init.d/gremlin-server /etc/rc4.d/S20gremlin-server -> ../init.d/gremlin-server /etc/rc5.d/S20gremlin-server -> ../init.d/gremlin-server daniel@cube ~ $ sudo update-rc.d -f gremlin-server enable update-rc.d: warning: start runlevel arguments (none) do not match gremlin-server Default-Start values (2 3 4 5) update-rc.d: warning: stop runlevel arguments (none) do not match gremlin-server Default-Stop values (0 1 6) Enabling system startup links for /etc/init.d/gremlin-server ... Removing any system startup links for /etc/init.d/gremlin-server ... /etc/rc0.d/K20gremlin-server /etc/rc1.d/K20gremlin-server /etc/rc2.d/S20gremlin-server /etc/rc3.d/S20gremlin-server /etc/rc4.d/S20gremlin-server /etc/rc5.d/S20gremlin-server /etc/rc6.d/K20gremlin-server Adding system startup for /etc/init.d/gremlin-server ... /etc/rc0.d/K20gremlin-server -> ../init.d/gremlin-server /etc/rc1.d/K20gremlin-server -> ../init.d/gremlin-server /etc/rc6.d/K20gremlin-server -> ../init.d/gremlin-server /etc/rc2.d/S20gremlin-server -> ../init.d/gremlin-server /etc/rc3.d/S20gremlin-server -> ../init.d/gremlin-server /etc/rc4.d/S20gremlin-server -> ../init.d/gremlin-server /etc/rc5.d/S20gremlin-server -> ../init.d/gremlin-server ``` Then I rebooted my system and Gremlin Server started right away. Great! Finally I removed the system service: ``` daniel@cube ~ $ sudo update-rc.d gremlin-server disable update-rc.d: warning: start runlevel arguments (none) do not match gremlin-server Default-Start values (2 3 4 5) update-rc.d: warning: stop runlevel arguments (none) do not match gremlin-server Default-Stop values (0 1 6) Disabling system startup links for /etc/init.d/gremlin-server ... Removing any system startup links for /etc/init.d/gremlin-server ... /etc/rc0.d/K20gremlin-server /etc/rc1.d/K20gremlin-server /etc/rc2.d/S20gremlin-server /etc/rc3.d/S20gremlin-server /etc/rc4.d/S20gremlin-server /etc/rc5.d/S20gremlin-server /etc/rc6.d/K20gremlin-server Adding system startup for /etc/init.d/gremlin-server ... /etc/rc0.d/K20gremlin-server -> ../init.d/gremlin-server /etc/rc1.d/K20gremlin-server -> ../init.d/gremlin-server /etc/rc6.d/K20gremlin-server -> ../init.d/gremlin-server /etc/rc2.d/K80gremlin-server -> ../init.d/gremlin-server /etc/rc3.d/K80gremlin-server -> ../init.d/gremlin-server /etc/rc4.d/K80gremlin-server -> ../init.d/gremlin-server /etc/rc5.d/K80gremlin-server -> ../init.d/gremlin-server daniel@cube ~ $ sudo update-rc.d -f gremlin-server remove Removing any system startup links for /etc/init.d/gremlin-server ... /etc/rc0.d/K20gremlin-server /etc/rc1.d/K20gremlin-server /etc/rc2.d/K80gremlin-server /etc/rc3.d/K80gremlin-server /etc/rc4.d/K80gremlin-server /etc/rc5.d/K80gremlin-server /etc/rc6.d/K20gremlin-server ``` That's it. No surprises, everything's working well. Nothing to add here, except ... VOTE: +1
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user dkuppitz commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/439#discussion_r88381583

          — Diff: gremlin-server/src/main/bin/gremlin-server.conf —
          @@ -0,0 +1,42 @@
          +#
          +# Licensed to the Apache Software Foundation (ASF) under one
          +# or more contributor license agreements. See the NOTICE file
          +# distributed with this work for additional information
          +# regarding copyright ownership. The ASF licenses this file
          +# to you under the Apache License, Version 2.0 (the
          +# "License"); you may not use this file except in compliance
          +# with the License. You may obtain a copy of the License at
          +#
          +# http://www.apache.org/licenses/LICENSE-2.0
          +#
          +# Unless required by applicable law or agreed to in writing,
          +# software distributed under the License is distributed on an
          +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
          +# KIND, either express or implied. See the License for the
          +# specific language governing permissions and limitations
          +# under the License.
          +#
          +
          +# initd: debug the initd script
          +#DEBUG=1
          +
          +# initd: gremlin server install location
          — End diff –

          I know, it's only a comment, but....

          gremlin server => Gremlin Server

          Show
          githubbot ASF GitHub Bot added a comment - Github user dkuppitz commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/439#discussion_r88381583 — Diff: gremlin-server/src/main/bin/gremlin-server.conf — @@ -0,0 +1,42 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# initd: debug the initd script +#DEBUG=1 + +# initd: gremlin server install location — End diff – I know, it's only a comment, but.... gremlin server => Gremlin Server
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user dkuppitz commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/439#discussion_r88381003

          — Diff: docs/src/reference/gremlin-applications.asciidoc —
          @@ -1482,6 +1513,62 @@ and standard deviation evaluation times, as well as the 75th, 95th, 98th, 99th a
          mean, and standard deviation evaluation times, as well as the 75th, 95th, 98th, 99th and 99.9th percentile evaluation
          times.

          +As A Service
          +^^^^^^^^^^^^
          +
          +Gremlin server can be configured to run as a service.
          +
          +Init.d (SysV)
          ++++++++++++++
          +
          +Link `bin/gremlin-server.sh` to `init.d`
          +Be sure to set RUNAS to the service user in `bin/gremlin-server.conf`
          +
          +[source,bash]
          +----
          +# Install
          +ln -s /path/to/apache-tinkerpop-gremlin-server-x.y.z/bin/gremlin-server.sh /etc/init.d/gremlin-server
          +
          +# Systems with chkconfig/service. E.g. Fedora, Red Hat
          +chkconfig --add gremlin-server
          +
          +# Start
          +service gremlin-server start
          +
          +# Or call directly
          +/etc/init.d/gremlin-server restart
          +
          +----
          +
          +Systemd
          ++++++++
          +
          +To install, copy the this service template to /etc/systemd/system/gremlin.service
          — End diff –

          Minor typo: "the this"

          Show
          githubbot ASF GitHub Bot added a comment - Github user dkuppitz commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/439#discussion_r88381003 — Diff: docs/src/reference/gremlin-applications.asciidoc — @@ -1482,6 +1513,62 @@ and standard deviation evaluation times, as well as the 75th, 95th, 98th, 99th a mean, and standard deviation evaluation times, as well as the 75th, 95th, 98th, 99th and 99.9th percentile evaluation times. +As A Service +^^^^^^^^^^^^ + +Gremlin server can be configured to run as a service. + +Init.d (SysV) ++++++++++++++ + +Link `bin/gremlin-server.sh` to `init.d` +Be sure to set RUNAS to the service user in `bin/gremlin-server.conf` + + [source,bash] +---- +# Install +ln -s /path/to/apache-tinkerpop-gremlin-server-x.y.z/bin/gremlin-server.sh /etc/init.d/gremlin-server + +# Systems with chkconfig/service. E.g. Fedora, Red Hat +chkconfig --add gremlin-server + +# Start +service gremlin-server start + +# Or call directly +/etc/init.d/gremlin-server restart + +---- + +Systemd ++++++++ + +To install, copy the this service template to /etc/systemd/system/gremlin.service — End diff – Minor typo: "the this"
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user dkuppitz commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/439#discussion_r88381456

          — Diff: docs/src/upgrade/release-3.3.x.asciidoc —
          @@ -31,3 +31,20 @@ Please see the link:https://github.com/apache/tinkerpop/blob/3.3.3/CHANGELOG.asc

          Upgrading for Users
          ~~~~~~~~~~~~~~~~~~~
          +
          +
          +Gremlin-server.sh and Init Scripts
          +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          +
          +`gremlin-server.sh` is now also an init script and can no longer be started without parameters. To start it in the foreground with defaults like previous usage, please use the `console` parameter. Also, `gremlin-server.sh` will continue to start in the foreground when provided a yaml configuration file.
          +
          +How to install as a service has been added to the link:http://tinkerpop.apache.org/docs/3.2.3/reference/#_as_a_service[Reference Documentation - As A Service].
          — End diff –

          The version in this (and the following) link should be 3.3.3.

          Show
          githubbot ASF GitHub Bot added a comment - Github user dkuppitz commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/439#discussion_r88381456 — Diff: docs/src/upgrade/release-3.3.x.asciidoc — @@ -31,3 +31,20 @@ Please see the link: https://github.com/apache/tinkerpop/blob/3.3.3/CHANGELOG.asc Upgrading for Users ~~~~~~~~~~~~~~~~~~~ + + +Gremlin-server.sh and Init Scripts +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +`gremlin-server.sh` is now also an init script and can no longer be started without parameters. To start it in the foreground with defaults like previous usage, please use the `console` parameter. Also, `gremlin-server.sh` will continue to start in the foreground when provided a yaml configuration file. + +How to install as a service has been added to the link: http://tinkerpop.apache.org/docs/3.2.3/reference/#_as_a_service[Reference Documentation - As A Service]. — End diff – The version in this (and the following) link should be 3.3.3.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user dkuppitz commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/439#discussion_r88381061

          — Diff: docs/src/reference/gremlin-applications.asciidoc —
          @@ -1482,6 +1513,62 @@ and standard deviation evaluation times, as well as the 75th, 95th, 98th, 99th a
          mean, and standard deviation evaluation times, as well as the 75th, 95th, 98th, 99th and 99.9th percentile evaluation
          times.

          +As A Service
          +^^^^^^^^^^^^
          +
          +Gremlin server can be configured to run as a service.
          +
          +Init.d (SysV)
          ++++++++++++++
          +
          +Link `bin/gremlin-server.sh` to `init.d`
          +Be sure to set RUNAS to the service user in `bin/gremlin-server.conf`
          +
          +[source,bash]
          +----
          +# Install
          +ln -s /path/to/apache-tinkerpop-gremlin-server-x.y.z/bin/gremlin-server.sh /etc/init.d/gremlin-server
          +
          +# Systems with chkconfig/service. E.g. Fedora, Red Hat
          +chkconfig --add gremlin-server
          +
          +# Start
          +service gremlin-server start
          +
          +# Or call directly
          +/etc/init.d/gremlin-server restart
          +
          +----
          +
          +Systemd
          ++++++++
          +
          +To install, copy the this service template to /etc/systemd/system/gremlin.service
          +and update the paths `/path/to/apache-tinkerpop-gremlin-server` with the actual install path of gremlin server.
          — End diff –

          gremlin server => Gremlin Server

          Show
          githubbot ASF GitHub Bot added a comment - Github user dkuppitz commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/439#discussion_r88381061 — Diff: docs/src/reference/gremlin-applications.asciidoc — @@ -1482,6 +1513,62 @@ and standard deviation evaluation times, as well as the 75th, 95th, 98th, 99th a mean, and standard deviation evaluation times, as well as the 75th, 95th, 98th, 99th and 99.9th percentile evaluation times. +As A Service +^^^^^^^^^^^^ + +Gremlin server can be configured to run as a service. + +Init.d (SysV) ++++++++++++++ + +Link `bin/gremlin-server.sh` to `init.d` +Be sure to set RUNAS to the service user in `bin/gremlin-server.conf` + + [source,bash] +---- +# Install +ln -s /path/to/apache-tinkerpop-gremlin-server-x.y.z/bin/gremlin-server.sh /etc/init.d/gremlin-server + +# Systems with chkconfig/service. E.g. Fedora, Red Hat +chkconfig --add gremlin-server + +# Start +service gremlin-server start + +# Or call directly +/etc/init.d/gremlin-server restart + +---- + +Systemd ++++++++ + +To install, copy the this service template to /etc/systemd/system/gremlin.service +and update the paths `/path/to/apache-tinkerpop-gremlin-server` with the actual install path of gremlin server. — End diff – gremlin server => Gremlin Server
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user dkuppitz commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/439#discussion_r88381095

          — Diff: docs/src/reference/gremlin-applications.asciidoc —
          @@ -1482,6 +1513,62 @@ and standard deviation evaluation times, as well as the 75th, 95th, 98th, 99th a
          mean, and standard deviation evaluation times, as well as the 75th, 95th, 98th, 99th and 99.9th percentile evaluation
          times.

          +As A Service
          +^^^^^^^^^^^^
          +
          +Gremlin server can be configured to run as a service.
          +
          +Init.d (SysV)
          ++++++++++++++
          +
          +Link `bin/gremlin-server.sh` to `init.d`
          +Be sure to set RUNAS to the service user in `bin/gremlin-server.conf`
          +
          +[source,bash]
          +----
          +# Install
          +ln -s /path/to/apache-tinkerpop-gremlin-server-x.y.z/bin/gremlin-server.sh /etc/init.d/gremlin-server
          +
          +# Systems with chkconfig/service. E.g. Fedora, Red Hat
          +chkconfig --add gremlin-server
          +
          +# Start
          +service gremlin-server start
          +
          +# Or call directly
          +/etc/init.d/gremlin-server restart
          +
          +----
          +
          +Systemd
          ++++++++
          +
          +To install, copy the this service template to /etc/systemd/system/gremlin.service
          +and update the paths `/path/to/apache-tinkerpop-gremlin-server` with the actual install path of gremlin server.
          +
          +[source,bash]
          +----
          +[Unit]
          +Description=Apache Tinkerpop Gremlin server daemon
          — End diff –

          Tinkerpop => TinkerPop
          Gremlin server => Gremlin Server

          Show
          githubbot ASF GitHub Bot added a comment - Github user dkuppitz commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/439#discussion_r88381095 — Diff: docs/src/reference/gremlin-applications.asciidoc — @@ -1482,6 +1513,62 @@ and standard deviation evaluation times, as well as the 75th, 95th, 98th, 99th a mean, and standard deviation evaluation times, as well as the 75th, 95th, 98th, 99th and 99.9th percentile evaluation times. +As A Service +^^^^^^^^^^^^ + +Gremlin server can be configured to run as a service. + +Init.d (SysV) ++++++++++++++ + +Link `bin/gremlin-server.sh` to `init.d` +Be sure to set RUNAS to the service user in `bin/gremlin-server.conf` + + [source,bash] +---- +# Install +ln -s /path/to/apache-tinkerpop-gremlin-server-x.y.z/bin/gremlin-server.sh /etc/init.d/gremlin-server + +# Systems with chkconfig/service. E.g. Fedora, Red Hat +chkconfig --add gremlin-server + +# Start +service gremlin-server start + +# Or call directly +/etc/init.d/gremlin-server restart + +---- + +Systemd ++++++++ + +To install, copy the this service template to /etc/systemd/system/gremlin.service +and update the paths `/path/to/apache-tinkerpop-gremlin-server` with the actual install path of gremlin server. + + [source,bash] +---- + [Unit] +Description=Apache Tinkerpop Gremlin server daemon — End diff – Tinkerpop => TinkerPop Gremlin server => Gremlin Server
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user dkuppitz commented on a diff in the pull request:

          https://github.com/apache/tinkerpop/pull/439#discussion_r88381587

          — Diff: gremlin-server/src/main/bin/gremlin-server.conf —
          @@ -0,0 +1,42 @@
          +#
          +# Licensed to the Apache Software Foundation (ASF) under one
          +# or more contributor license agreements. See the NOTICE file
          +# distributed with this work for additional information
          +# regarding copyright ownership. The ASF licenses this file
          +# to you under the Apache License, Version 2.0 (the
          +# "License"); you may not use this file except in compliance
          +# with the License. You may obtain a copy of the License at
          +#
          +# http://www.apache.org/licenses/LICENSE-2.0
          +#
          +# Unless required by applicable law or agreed to in writing,
          +# software distributed under the License is distributed on an
          +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
          +# KIND, either express or implied. See the License for the
          +# specific language governing permissions and limitations
          +# under the License.
          +#
          +
          +# initd: debug the initd script
          +#DEBUG=1
          +
          +# initd: gremlin server install location
          +#GREMLIN_HOME=
          +
          +# initd: Yaml file passed to gremlin server. Path can be absolute or relative to GREMLIN_HOME e.g. conf/gremlin-server.yaml
          — End diff –

          same as above

          Show
          githubbot ASF GitHub Bot added a comment - Github user dkuppitz commented on a diff in the pull request: https://github.com/apache/tinkerpop/pull/439#discussion_r88381587 — Diff: gremlin-server/src/main/bin/gremlin-server.conf — @@ -0,0 +1,42 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# initd: debug the initd script +#DEBUG=1 + +# initd: gremlin server install location +#GREMLIN_HOME= + +# initd: Yaml file passed to gremlin server. Path can be absolute or relative to GREMLIN_HOME e.g. conf/gremlin-server.yaml — End diff – same as above
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user spmallette commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          @PommeVerte do you think you might have some free time soon to review this and vote?

          Show
          githubbot ASF GitHub Bot added a comment - Github user spmallette commented on the issue: https://github.com/apache/tinkerpop/pull/439 @PommeVerte do you think you might have some free time soon to review this and vote?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user spmallette commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          LGTM

          Show
          githubbot ASF GitHub Bot added a comment - Github user spmallette commented on the issue: https://github.com/apache/tinkerpop/pull/439 LGTM
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user robertdale commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          @spmallette I pushed the windows changes. can you review?

          Show
          githubbot ASF GitHub Bot added a comment - Github user robertdale commented on the issue: https://github.com/apache/tinkerpop/pull/439 @spmallette I pushed the windows changes. can you review?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user spmallette commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          Tested all the command line options and all work nicely. Good documentation.

          It did occur to me that we don't have analogous features for windows in that the gremlin-server.sh does not behave like the gremlin-server.bat. I'd suggest two things:

          1. Maybe just add a "WARNING:" to the docs to mention that discrepancy and that gremlin-server.bat always starts Gremlin Server in the foreground.
          2. Change gremlin-server.bat to use "install" instead of "-i"

          Other than that, looks good to me:

          VOTE +1

          Show
          githubbot ASF GitHub Bot added a comment - Github user spmallette commented on the issue: https://github.com/apache/tinkerpop/pull/439 Tested all the command line options and all work nicely. Good documentation. It did occur to me that we don't have analogous features for windows in that the gremlin-server.sh does not behave like the gremlin-server.bat. I'd suggest two things: 1. Maybe just add a "WARNING:" to the docs to mention that discrepancy and that gremlin-server.bat always starts Gremlin Server in the foreground. 2. Change gremlin-server.bat to use "install" instead of "-i" Other than that, looks good to me: VOTE +1
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user robertdale commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          Rebased. Retested.

          VOTE +1

          Show
          githubbot ASF GitHub Bot added a comment - Github user robertdale commented on the issue: https://github.com/apache/tinkerpop/pull/439 Rebased. Retested. VOTE +1
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user spmallette commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          I believe @PommeVerte is on a month long holiday at this point. imo, i think we could move the ubuntu script off to a different ticket as you have a lot of work in place here. I would just rebase on master, move your changelog/upgrade docs stuff to be under 3.3.0 and we can move to vote.

          And of course, now that you're a committer @robertdale you should VOTE on your own stuff for a free +1

          Show
          githubbot ASF GitHub Bot added a comment - Github user spmallette commented on the issue: https://github.com/apache/tinkerpop/pull/439 I believe @PommeVerte is on a month long holiday at this point. imo, i think we could move the ubuntu script off to a different ticket as you have a lot of work in place here. I would just rebase on master, move your changelog/upgrade docs stuff to be under 3.3.0 and we can move to vote. And of course, now that you're a committer @robertdale you should VOTE on your own stuff for a free +1
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user robertdale commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          @PommeVerte do you mind if we move the ubuntu script to a separate pull request so this one can move forward?

          Show
          githubbot ASF GitHub Bot added a comment - Github user robertdale commented on the issue: https://github.com/apache/tinkerpop/pull/439 @PommeVerte do you mind if we move the ubuntu script to a separate pull request so this one can move forward?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user PommeVerte commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          I'm currently on some ressource intensive tasks so it's hard for me to bounce back and forth between projects but I would like to give this a run on ubuntu 14.04. I suspect that sysV might work out of the box with a simple change in commands.
          Will give this a spin asap.

          Show
          githubbot ASF GitHub Bot added a comment - Github user PommeVerte commented on the issue: https://github.com/apache/tinkerpop/pull/439 I'm currently on some ressource intensive tasks so it's hard for me to bounce back and forth between projects but I would like to give this a run on ubuntu 14.04. I suspect that sysV might work out of the box with a simple change in commands. Will give this a spin asap.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user robertdale commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          I just tested with backgrounding the job and killing that. That also still works.

          Show
          githubbot ASF GitHub Bot added a comment - Github user robertdale commented on the issue: https://github.com/apache/tinkerpop/pull/439 I just tested with backgrounding the job and killing that. That also still works.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user spmallette commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          oh - right - you had said that. sorry

          Show
          githubbot ASF GitHub Bot added a comment - Github user spmallette commented on the issue: https://github.com/apache/tinkerpop/pull/439 oh - right - you had said that. sorry
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user robertdale commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          That should still work. What won't work is an invocation of just "gremlin-server.sh" without parameters. I didn't find any in the code base nor in the docs (which is highly convenient).

          Show
          githubbot ASF GitHub Bot added a comment - Github user robertdale commented on the issue: https://github.com/apache/tinkerpop/pull/439 That should still work. What won't work is an invocation of just "gremlin-server.sh" without parameters. I didn't find any in the code base nor in the docs (which is highly convenient).
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user spmallette commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          It occurred to me that it would seem there must be a place that gremlin-server.sh is used in doc generation - and here it is:

          https://github.com/apache/tinkerpop/blob/8ab682fef3e3da12904cb0d825abf4cc1ba8235a/docs/preprocessor/preprocess.sh#L84

          I assume that command will no longer work with these changes and a fix is needed there? @dkuppitz any other secret areas you know about where gremlin-server.sh is used?

          Show
          githubbot ASF GitHub Bot added a comment - Github user spmallette commented on the issue: https://github.com/apache/tinkerpop/pull/439 It occurred to me that it would seem there must be a place that gremlin-server.sh is used in doc generation - and here it is: https://github.com/apache/tinkerpop/blob/8ab682fef3e3da12904cb0d825abf4cc1ba8235a/docs/preprocessor/preprocess.sh#L84 I assume that command will no longer work with these changes and a fix is needed there? @dkuppitz any other secret areas you know about where gremlin-server.sh is used?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user robertdale commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          Cool. I was wondering how to link. Didn't think it was absolute. I hope it works. Tried testing with `./docker/build.sh -d` but it hangs at installing plugins `* hadoop-gremlin ...`.

          Show
          githubbot ASF GitHub Bot added a comment - Github user robertdale commented on the issue: https://github.com/apache/tinkerpop/pull/439 Cool. I was wondering how to link. Didn't think it was absolute. I hope it works. Tried testing with `./docker/build.sh -d` but it hangs at installing plugins `* hadoop-gremlin ...`.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user spmallette commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          wow - @robertdale - this is a really nice PR. I added the "breaking" label to the JIRA ticket as this would prevent gremlin-server.sh from working as it did before. I think I'm ok with that, but we should probably have a DISCUSS on the dev list about that just to bring it to everyone's attention to make sure there are no objections. Do you mind starting that thread for us - otherwise I will kick one off?

          As for the PR itself, I can test this manually, but will have to rely on others for code review. gremlin-server.sh is looking pretty legit!

          Show
          githubbot ASF GitHub Bot added a comment - Github user spmallette commented on the issue: https://github.com/apache/tinkerpop/pull/439 wow - @robertdale - this is a really nice PR. I added the "breaking" label to the JIRA ticket as this would prevent gremlin-server.sh from working as it did before. I think I'm ok with that, but we should probably have a DISCUSS on the dev list about that just to bring it to everyone's attention to make sure there are no objections. Do you mind starting that thread for us - otherwise I will kick one off? As for the PR itself, I can test this manually, but will have to rely on others for code review. gremlin-server.sh is looking pretty legit!
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user robertdale commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          • `gremlin-server.sh` is the init script. This makes it more inline with other Apache servers like Tomcat, ActiveMQ, solr, etc.
          • Moved how to install "As A Service" from Upgrade to Gremlin Server Configuration per @PommeVerte
          • Also added parameters and environment config to Server Configuration section
          • Deprecated `-i` in favor of `install`
          • Starting `gremlin-server.sh` without parameters is a breaking change. Amazingly, it's not ever actually used anywhere without parameters.
          Show
          githubbot ASF GitHub Bot added a comment - Github user robertdale commented on the issue: https://github.com/apache/tinkerpop/pull/439 `gremlin-server.sh` is the init script. This makes it more inline with other Apache servers like Tomcat, ActiveMQ, solr, etc. Moved how to install "As A Service" from Upgrade to Gremlin Server Configuration per @PommeVerte Also added parameters and environment config to Server Configuration section Deprecated `-i` in favor of `install` Starting `gremlin-server.sh` without parameters is a breaking change. Amazingly, it's not ever actually used anywhere without parameters.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user robertdale commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          Maybe if the script detects that it's called via link with no parameters, then it's in initd mode and displays help. If the script is called directly with no parameters, then it just runs in foreground. Then there's no breaking change.

          Show
          githubbot ASF GitHub Bot added a comment - Github user robertdale commented on the issue: https://github.com/apache/tinkerpop/pull/439 Maybe if the script detects that it's called via link with no parameters, then it's in initd mode and displays help. If the script is called directly with no parameters, then it just runs in foreground. Then there's no breaking change.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user robertdale commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          Upstart looks simple enough. I don't know if the one @dkuppitz created, referenced in TINKERPOP-980 , is still viable. But I can't test. Any volunteers?

          I would have to say that it's not customary for systemd/upstart templates to be in `bin/`. They're really not binaries, more like configuration for those apps. Maybe create an `extras/` dir?

          The initd script is a real, executable script with `start, stop, status`. I didn't want to modify `gremlin-server.sh` since it has some functionality over a pure init script like install deps, run in foreground, pass conf file. However, it also has its short-comings like it can only be run in the install dir. The initd script can be run from anywhere and also can be directly referenced from initd. That said, it's not unusual for the main server script to also be the initd script.

          My preference would be to merge the two. But there should be a breaking change in that executing `gremlin-server.sh` would show help instead of running in the foreground. Would probably add a new option to run in foreground, `start -f`. Passing a conf file can still work, with or without start. `-i` can still work.

          Show
          githubbot ASF GitHub Bot added a comment - Github user robertdale commented on the issue: https://github.com/apache/tinkerpop/pull/439 Upstart looks simple enough. I don't know if the one @dkuppitz created, referenced in TINKERPOP-980 , is still viable. But I can't test. Any volunteers? I would have to say that it's not customary for systemd/upstart templates to be in `bin/`. They're really not binaries, more like configuration for those apps. Maybe create an `extras/` dir? The initd script is a real, executable script with `start, stop, status`. I didn't want to modify `gremlin-server.sh` since it has some functionality over a pure init script like install deps, run in foreground, pass conf file. However, it also has its short-comings like it can only be run in the install dir. The initd script can be run from anywhere and also can be directly referenced from initd. That said, it's not unusual for the main server script to also be the initd script. My preference would be to merge the two. But there should be a breaking change in that executing `gremlin-server.sh` would show help instead of running in the foreground. Would probably add a new option to run in foreground, `start -f`. Passing a conf file can still work, with or without start. `-i` can still work.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user spmallette commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          I like the suggestion @PommeVerte made to have some docs in the gremlin-server section somewhere. Then you could just reference them from the upgrade docs.

          I don't know what an upstart script entails so i'm not sure if a separate body of work for it is required or not.

          Finally, not sure where this should be in the repo. Is it customary to find these in a `bin/` directory?

          Show
          githubbot ASF GitHub Bot added a comment - Github user spmallette commented on the issue: https://github.com/apache/tinkerpop/pull/439 I like the suggestion @PommeVerte made to have some docs in the gremlin-server section somewhere. Then you could just reference them from the upgrade docs. I don't know what an upstart script entails so i'm not sure if a separate body of work for it is required or not. Finally, not sure where this should be in the repo. Is it customary to find these in a `bin/` directory?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user PommeVerte commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          Just confirming that although ubuntu 14.04 has `systemd` it does not have `systemd-as-init` . So an upstart would be a good idea and should be relatively easy since this PR seems to be thorough.

          Question is, do we make a separate PR for this or not?

          Also maybe we should add some more documentation around this (instead of only having the upgrade docs)? Like in the gremlin-server section.

          Show
          githubbot ASF GitHub Bot added a comment - Github user PommeVerte commented on the issue: https://github.com/apache/tinkerpop/pull/439 Just confirming that although ubuntu 14.04 has `systemd` it does not have `systemd-as-init` . So an upstart would be a good idea and should be relatively easy since this PR seems to be thorough. Question is, do we make a separate PR for this or not? Also maybe we should add some more documentation around this (instead of only having the upgrade docs)? Like in the gremlin-server section.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user PommeVerte commented on the issue:

          https://github.com/apache/tinkerpop/pull/439

          Should we add upstart to this PR? I'm not sure if the systemd covers older versions of ubuntu. Namely 14.04LTS ?

          Show
          githubbot ASF GitHub Bot added a comment - Github user PommeVerte commented on the issue: https://github.com/apache/tinkerpop/pull/439 Should we add upstart to this PR? I'm not sure if the systemd covers older versions of ubuntu. Namely 14.04LTS ?
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user robertdale opened a pull request:

          https://github.com/apache/tinkerpop/pull/439

          TINKERPOP-980: added sysv and systemd init scripts

          I don't know if you want all of this in bin/. I could definitely see the systemd gremlin-server.service moving out since it's more of a template but I don't know where else to put it.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/robertdale/tinkerpop TINKERPOP-980

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/tinkerpop/pull/439.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #439


          commit 84ddacd6a88eb8291a3a5df1a7c5a0b225e1f5fd
          Author: Robert Dale <robdale@gmail.com>
          Date: 2016-09-28T00:27:47Z

          added sysv and systemd init scripts


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user robertdale opened a pull request: https://github.com/apache/tinkerpop/pull/439 TINKERPOP-980 : added sysv and systemd init scripts I don't know if you want all of this in bin/. I could definitely see the systemd gremlin-server.service moving out since it's more of a template but I don't know where else to put it. You can merge this pull request into a Git repository by running: $ git pull https://github.com/robertdale/tinkerpop TINKERPOP-980 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/439.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #439 commit 84ddacd6a88eb8291a3a5df1a7c5a0b225e1f5fd Author: Robert Dale <robdale@gmail.com> Date: 2016-09-28T00:27:47Z added sysv and systemd init scripts
          Hide
          rdale Robert Dale added a comment -

          I'll provide a SysV init and systemd file for 3.2.

          Show
          rdale Robert Dale added a comment - I'll provide a SysV init and systemd file for 3.2.
          Hide
          spmallette stephen mallette added a comment -

          Release 3.1.4 is for bugs only at this point as per discussion on the mailing list.

          Show
          spmallette stephen mallette added a comment - Release 3.1.4 is for bugs only at this point as per discussion on the mailing list.
          Hide
          dmill Dylan Millikin added a comment -

          I'm going through my emails (finally getting to the end of it.) Looking at this again what are we lacking? Does Daniel's code need updating? it looks good at first glance. Though some work for other distros may be required.

          Do we want an install.sh script that would set this up automatically? Maybe also create a gremlin user on the system and have the startup script use that.

          What about windows? (I guess I'm trying to grasp the scope of this issue)

          Show
          dmill Dylan Millikin added a comment - I'm going through my emails (finally getting to the end of it.) Looking at this again what are we lacking? Does Daniel's code need updating? it looks good at first glance. Though some work for other distros may be required. Do we want an install.sh script that would set this up automatically? Maybe also create a gremlin user on the system and have the startup script use that. What about windows? (I guess I'm trying to grasp the scope of this issue)
          Hide
          jeromatron Jeremy Hanna added a comment -

          To clarify, I suppose I just mean that I prefer servers to background by default and have a foreground option. Having a service example would be nice too, but varies from distro to distro too.

          Show
          jeromatron Jeremy Hanna added a comment - To clarify, I suppose I just mean that I prefer servers to background by default and have a foreground option. Having a service example would be nice too, but varies from distro to distro too.

            People

            • Assignee:
              rdale Robert Dale
              Reporter:
              jeromatron Jeremy Hanna
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development