Update documentation on sysv init script setup.

This commit is contained in:
Mark Nellemann 2022-08-27 10:30:18 +02:00
parent 36aadbd5cc
commit abef741218
9 changed files with 30 additions and 10 deletions

View file

@ -13,7 +13,7 @@ subprojects {
apply plugin: 'groovy' apply plugin: 'groovy'
dependencies { dependencies {
testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0' testImplementation 'org.spockframework:spock-core:2.1-groovy-3.0'
testImplementation "org.slf4j:slf4j-api:${slf4jVersion}" testImplementation "org.slf4j:slf4j-api:${slf4jVersion}"
testImplementation "org.slf4j:slf4j-simple:${slf4jVersion}" testImplementation "org.slf4j:slf4j-simple:${slf4jVersion}"

View file

@ -1,5 +1,5 @@
[Unit] [Unit]
Description=Sysmon Client Service Description=Sysmon Client
[Service] [Service]
#User=nobody #User=nobody

View file

@ -11,7 +11,7 @@
dir="/opt/sysmon/client" dir="/opt/sysmon/client"
cmd="/opt/sysmon/client/bin/client" cmd="/opt/sysmon/client/bin/client"
args="-s http://10.20.30.40:9925/metrics" args="-s http://10.20.30.40:9925/metrics" # Specify sysmon-server URL here
user="" user=""
name=`basename $0` name=`basename $0`
@ -19,6 +19,10 @@ pid_file="/var/run/$name.pid"
stdout_log="/var/log/$name.log" stdout_log="/var/log/$name.log"
stderr_log="/var/log/$name.err" stderr_log="/var/log/$name.err"
# Uncomment if required
#JAVA_HOME=/usr/java8_64
#export JAVA_HOME
get_pid() { get_pid() {
cat "$pid_file" cat "$pid_file"
} }

View file

@ -1,4 +1,4 @@
# SystemD Notes # Linux systemd notes
Edit the *sysmon-client.service* file and change the sysmon-server URL accordingly to your environment. Edit the *sysmon-client.service* file and change the sysmon-server URL accordingly to your environment.
@ -9,4 +9,4 @@ cp sysmon-client.service /etc/systemd/system/
systemctl daemon-reload systemctl daemon-reload
systemctl enable sysmon-client systemctl enable sysmon-client
systemctl restart sysmon-client systemctl restart sysmon-client
``` ```

View file

@ -1,6 +1,18 @@
# SysV init Notes # SysV init Notes
- Copy the *sysmon-client.sh* into *sysmon-client* in the correct location for init scripts on your operating system. - Copy the *sysmon-client.sh* into *sysmon-client* in the correct location for init scripts on your operating system.
- Edit the file to specify sysmon-server URL in the *args* variable. - Edit the file and specify the sysmon-server URL in the *args* variable.
- Edit the file and uncomment *JAVA_HOME* if required
- SymLink to the required run-levels. - SymLink to the required run-levels.
## AIX & VIO
```shell
# Remember to edit and set JAVA_HOME to eg. /usr/java8_64
cp sysmon-client.sh /etc/rc.d/init.d/sysmon-client
chmod +x /etc/rc.d/init.d/sysmon-client
ln -s /etc/rc.d/init.d/sysmon-client /etc/rc.d/rc2.d/Ssysmon-client
ln -s /etc/rc.d/init.d/sysmon-client /etc/rc.d/rc2.d/Ksysmon-client
```

View file

@ -10,7 +10,7 @@ subprojects {
apply plugin: 'groovy' apply plugin: 'groovy'
dependencies { dependencies {
testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0' testImplementation 'org.spockframework:spock-core:2.1-groovy-3.0'
testImplementation "org.slf4j:slf4j-api:${slf4jVersion}" testImplementation "org.slf4j:slf4j-api:${slf4jVersion}"
testImplementation "org.slf4j:slf4j-simple:${slf4jVersion}" testImplementation "org.slf4j:slf4j-simple:${slf4jVersion}"
testImplementation project(':shared') testImplementation project(':shared')

View file

@ -28,7 +28,7 @@ def projectName = "sysmon-server"
application { application {
// Define the main class for the application. // Define the main class for the application.
mainClass.set('sysmon.server.Application') mainClass.set('sysmon.server.Application')
applicationDefaultJvmArgs = [ "-server", "-Xmx128m" ] applicationDefaultJvmArgs = [ "-server", "-Xmx64m" ]
} }
run { run {

View file

@ -19,6 +19,10 @@ pid_file="/var/run/$name.pid"
stdout_log="/var/log/$name.log" stdout_log="/var/log/$name.log"
stderr_log="/var/log/$name.err" stderr_log="/var/log/$name.err"
# Uncomment if required
#JAVA_HOME=/usr/java8_64
#export JAVA_HOME
get_pid() { get_pid() {
cat "$pid_file" cat "$pid_file"
} }

View file

@ -1,4 +1,4 @@
# SystemD Notes # Linux systemd notes
Setup as systemd service to start automatically at boot: Setup as systemd service to start automatically at boot:
@ -7,4 +7,4 @@ cp sysmon-server.service /etc/systemd/system/
systemctl daemon-reload systemctl daemon-reload
systemctl enable sysmon-server systemctl enable sysmon-server
systemctl restart sysmon-server systemctl restart sysmon-server
``` ```