Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
3e496090
Commit
3e496090
authored
Apr 10, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
started work on new rpm package
parent
c47f4bc9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
1 deletions
+72
-1
packaging/deb/control/postinst
+1
-1
packaging/rpm/control/postinst
+71
-0
No files found.
packaging/deb/control/postinst
View file @
3e496090
...
...
@@ -2,7 +2,7 @@
set
-e
[
-f
/etc/default/grafana
]
&&
.
/etc/default/grafana
[
-f
/etc/default/grafana
-server
]
&&
.
/etc/default/grafana-server
startGrafana
()
{
if
[
-x
/bin/systemctl
]
;
then
...
...
packaging/rpm/control/postinst
View file @
3e496090
#!/bin/sh
set
-e
[
-f
/etc/sysconfig/grafana-server
]
&&
.
/etc/sysconfig/grafana-server
startGrafana
()
{
if
[
-x
/bin/systemctl
]
;
then
/bin/systemctl start grafana-server.service
elif
[
-x
/etc/init.d/grafana-server
]
;
then
/etc/init.d/grafana-server start
elif
[
-x
/etc/rc.d/init.d/grafana-server
]
;
then
/etc/rc.d/init.d/grafana-server start
fi
}
stopGrafana
()
{
if
[
-x
/bin/systemctl
]
;
then
/bin/systemctl stop grafana-server.service
>
/dev/null 2>&1
||
:
elif
[
-x
/etc/init.d/grafana-service
]
;
then
/etc/init.d/grafana-service stop
elif
[
-x
/etc/rc.d/init.d/grafana-service
]
;
then
/etc/rc.d/init.d/grafana-service stop
fi
}
case
"
$1
"
in
configure
)
[
-z
"
$GRAFANA_USER
"
]
&&
GRAFANA_USER
=
"grafana"
[
-z
"
$GRAFANA_GROUP
"
]
&&
GRAFANA_GROUP
=
"grafana"
if
!
getent group
"
$GRAFANA_GROUP
"
>
/dev/null 2>&1
;
then
addgroup
--system
"
$GRAFANA_GROUP
"
--quiet
fi
if
!
id
$GRAFANA_USER
>
/dev/null 2>&1
;
then
adduser
--system
--home
/usr/share/grafana
--no-create-home
\
--ingroup
"
$GRAFANA_GROUP
"
--disabled-password
--shell
/bin/false
\
"
$GRAFANA_USER
"
fi
# Set user permissions on /var/log/grafana, /var/lib/grafana
mkdir
-p
/var/log/grafana /var/lib/grafana
chown
-R
$GRAFANA_USER
:
$GRAFANA_GROUP
/var/log/grafana /var/lib/grafana
chmod 755 /var/log/grafana /var/lib/grafana
# configuration files should not be modifiable by grafana user, as this can be a security issue
chown
-Rh
root:root /etc/grafana/
*
chmod 755 /etc/grafana
find /etc/grafana
-type
f
-exec
chmod 644
{}
';'
find /etc/grafana
-type
d
-exec
chmod 755
{}
';'
# if $2 is set, this is an upgrade
if
(
[
-n
$2
]
&&
[
"
$RESTART_ON_UPGRADE
"
=
"true"
]
)
;
then
startGrafana
# this is a fresh installation
elif
[
-z
$2
]
;
then
if
[
-x
/bin/systemctl
]
;
then
echo
"### NOT starting on installation, please execute the following statements to configure elasticsearch to start automatically using systemd"
echo
" sudo /bin/systemctl daemon-reload"
echo
" sudo /bin/systemctl enable grafana-server.service"
echo
"### You can start grafana-server by executing"
echo
" sudo /bin/systemctl start grafana-server.service"
elif
[
-x
/usr/sbin/update-rc.d
]
;
then
echo
"### NOT starting grafana-server by default on bootup, please execute"
echo
" sudo update-rc.d grafana-server defaults 95 10"
echo
"### In order to start grafana-server, execute"
echo
" sudo service grafana-server start"
fi
fi
;;
esac
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment