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

MINIFICPP-2181 Use systemd service management on Linux #1627

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ cmake-build-debug
build
/*build*
bt_state
bin
target
thirdparty/**/*.o
thirdparty/**/*.a
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ if (NOT WIN32)
DESTINATION minifi-python
COMPONENT bin)

install(PROGRAMS bin/minifi.sh
install(PROGRAMS bin/minifi.sh bin/minifi.service
DESTINATION bin
COMPONENT bin)
endif()
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -501,25 +501,25 @@ $ cd nifi-minifi-cpp-*
### Configuring
The 'conf' directory in the installation root contains a template config.yml document, minifi.properties, and minifi-log.properties. Please see our [Configuration document](CONFIGURE.md) for details on how to configure agents.

### Installing as a service

MiNiFi can also be installed as a system service using minifi.sh:

$ ./bin/minifi.sh install

### Running
After completing the [installation](#installation), the application can be run by issuing the following command from the installation directory:
After completing the [installation](#installing-as-a-service), the application can be run by issuing the following command from the installation directory:

$ ./bin/minifi.sh start

By default, this will make use of a config.yml located in the conf directory. This configuration file location can be altered by adjusting the property `nifi.flow.configuration.file` in minifi.properties located in the conf directory.
By default, this will make use of a config.yml located in the conf directory. This configuration file location can be altered by adjusting the property `nifi.flow.configuration.file` in minifi.properties located in the conf directory.

### Stopping

MiNiFi can then be stopped by issuing:

$ ./bin/minifi.sh stop

### Installing as a service

MiNiFi can also be installed as a system service using minifi.sh with an optional "service name" (default: minifi)

$ ./bin/minifi.sh install [service name]

### Running as a docker container
You can use the officially released image pulled from the [apache/nifi-minifi-cpp](https://hub.docker.com/r/apache/nifi-minifi-cpp) repository on dockerhub or you can use your locally built image.
The container can be run with a specific configuration by mounting the locally edited configuration files to your docker container.
Expand Down
16 changes: 16 additions & 0 deletions bin/minifi.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Starts and stops the MiNiFi C++ Agent
After=network.target

[Service]
Type=simple
Environment=MINIFI_HOME=/opt/minifi-cpp
ExecStart=/opt/minifi-cpp/bin/minifi
Restart=on-failure
RestartSec=3
KillSignal=SIGTERM
TimeoutStopSec=20
RestartForceExitStatus=3

[Install]
WantedBy=multi-user.target
Loading