Skip to content

Commit

Permalink
Bugfix systemd files; exclude important system config files from rest…
Browse files Browse the repository at this point in the history
…oring when updating; fix grafana version
  • Loading branch information
mschlenstedt committed Oct 22, 2022
1 parent f6cc52a commit 56472a5
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 18 deletions.
26 changes: 14 additions & 12 deletions config/grafana/grafana.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ data = REPLACELBPDATADIR/grafana
temp_data_lifetime = 24h

# Directory where grafana can store logs
logs = REPLACELBPDATADIR/grafana
#logs = REPLACELBPDATADIR/grafana
logs = /var/log/grafana

# Directory where grafana will automatically scan and look for plugins
plugins = /var/lib/grafana/plugins
Expand Down Expand Up @@ -540,7 +541,7 @@ org_role = Admin
;mode = console file

# Either "debug", "info", "warn", "error", "critical", default is "info"
level = error
level = info

# optional settings to set different levels for specific loggers. Ex filters = sqlstore:debug
;filters =
Expand All @@ -554,38 +555,39 @@ level = error

# For "file" mode only
[log.file]
;level =
level = info

# log line format, valid options are text, console and json
;format = text
format = text

# This enables automated log rotate(switch of following options), default is true
;log_rotate = true
log_rotate = true

# Max line number of single file, default is 1000000
;max_lines = 1000000
max_lines = 1000000

# Max size shift of single file, default is 28 means 1 << 28, 256MB
;max_size_shift = 28
# 22 means ~ 4 MB
max_size_shift = 22

# Segment log daily, default is true
;daily_rotate = true
daily_rotate = true

# Expired days of log file(delete after max days), default is 7
;max_days = 7
max_days = 2

[log.syslog]
;level =
level = error

# log line format, valid options are text, console and json
;format = text
format = text

# Syslog network type and address. This can be udp, tcp, or unix. If left blank, the default unix endpoints will be used.
;network =
;address =

# Syslog facility. user, daemon and local0 through local7 are valid.
;facility =
facility = daemon

# Syslog tag. By default, the process' argv[0] is used.
;tag =
Expand Down
2 changes: 1 addition & 1 deletion config/systemd/00-stats4lox-grafana.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[Service]
StandardError=null
StandardOutput=null
StandardOutput=null
2 changes: 1 addition & 1 deletion config/systemd/00-stats4lox-telegraf.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[Service]
StandardError=null
StandardOutput=null
StandardOutput=null
2 changes: 1 addition & 1 deletion plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ [email protected]
# The version of your plugin - important if you would like to write an
# upgrade script. Use a correct syntax, which is supported by LoxBerry:
# More info: http://www.loxwiki.eu/x/LYG3AQ
VERSION=0.9.7
VERSION=0.9.8

# Short name and prefered subfolder of your Plugin (do not use blanks - they
# will be filtered - and use lowercase only)! Used for script names in
Expand Down
2 changes: 1 addition & 1 deletion postroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ if [ -d $LBHOMEDIR/data/plugins/$PTEMPDIR\_upgrade ]; then
# Config
if [ -n "$(ls -A "$LBHOMEDIR/data/plugins/${PTEMPDIR}_upgrade/config/" 2>/dev/null)" ]; then
chown -R loxberry:loxberry $PCONFIG
rsync -Iav $LBHOMEDIR/data/plugins/${PTEMPDIR}_upgrade/config/* $PCONFIG/
rsync -Iav --exclude "systemd/*" --exclude "sysctl.conf" $LBHOMEDIR/data/plugins/${PTEMPDIR}_upgrade/config/* $PCONFIG/
if [ $? -ne 0 ]; then
echo "<FAIL> Restoring config files failed. Giving up."
#pause 'Press [Enter] key to continue...'
Expand Down
12 changes: 10 additions & 2 deletions preroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,19 @@ wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add - 2>/dev/
source /etc/os-release
echo "deb https://repos.influxdata.com/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/influxdb.list

echo "<INFO> Using Influx Version 1.8.9..."
echo "<INFO> Using Influx Version 1.8.x..."
rm -f /etc/apt/preferences.d/influxdb
cat <<EOT >> /etc/apt/preferences.d/influxdb
Package: influxdb
Pin: version 1.*
Pin: version 1.8.*
Pin-Priority: 1000
EOT

echo "<INFO> Using Grafana Version 9.2.x..."
rm -f /etc/apt/preferences.d/grafana
cat <<EOT >> /etc/apt/preferences.d/grafana
Package: grafana
Pin: version 9.2.*
Pin-Priority: 1000
EOT

Expand Down

0 comments on commit 56472a5

Please sign in to comment.