improve init.d docs
This commit is contained in:
parent
f2f3decd78
commit
c956283fbe
|
@ -3,31 +3,35 @@
|
||||||
Run the following commands as root:
|
Run the following commands as root:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Install at /opt/metrics.sh
|
# Install metrics.sh at /opt/metrics.sh
|
||||||
$ mkdir /opt && cd /opt
|
$ mkdir /opt; cd /opt
|
||||||
$ git clone https://github.com/pstadler/metrics.sh.git
|
$ git clone https://github.com/pstadler/metrics.sh.git
|
||||||
$ cd metrics.sh
|
$ cd metrics.sh
|
||||||
# Install service
|
# Install the service
|
||||||
$ ln -s $PWD/init.d/metrics.sh /etc/init.d/metrics.sh
|
$ ln -s $PWD/init.d/metrics.sh /etc/init.d/metrics.sh
|
||||||
# Create config file
|
# Create a config file
|
||||||
$ mkdir /etc/metrics.sh && chmod 600 /etc/metrics.sh
|
$ mkdir /etc/metrics.sh && chmod 600 /etc/metrics.sh
|
||||||
$ ./metrics.sh -C > /etc/metrics.sh/metrics.ini
|
$ ./metrics.sh -C > /etc/metrics.sh/metrics.ini
|
||||||
# At this point you should edit your config file
|
# At this point you should edit your config file at
|
||||||
# at /etc/metrics.sh/metrics.ini
|
# /etc/metrics.sh/metrics.ini
|
||||||
|
|
||||||
# Start service
|
# Start service
|
||||||
$ service metrics.sh start
|
$ service metrics.sh start
|
||||||
|
|
||||||
|
# If run with the default configuration where reporter is 'stdout', metrics
|
||||||
|
# will be written to /var/log/metrics.sh.log. Be aware that this file will
|
||||||
|
# grow fast.
|
||||||
|
$ tail -f /var/log/metrics.sh.log
|
||||||
|
|
||||||
# Stop service
|
# Stop service
|
||||||
$ service metrics.sh stop
|
$ service metrics.sh stop
|
||||||
# Check servie status
|
|
||||||
|
# Check service status
|
||||||
$ service metrics.sh status
|
$ service metrics.sh status
|
||||||
|
|
||||||
# Check log file
|
# Automatically start service when booting and stop when shutting down
|
||||||
$ tail /var/log/metrics.sh.log
|
|
||||||
|
|
||||||
# Automatically start/stop service when (re-)booting
|
|
||||||
$ update-rc.d metrics.sh defaults
|
$ update-rc.d metrics.sh defaults
|
||||||
|
|
||||||
# Uninstall automatic start/stop
|
# Disable automatic starting/stopping
|
||||||
$ update-rc.d -f metrics.sh remove
|
$ update-rc.d -f metrics.sh remove
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue