git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
54d6cde
)
first fixes in the systemd/ area
author
Thierry Parmentelat
<thierry.parmentelat@inria.fr>
Sat, 26 May 2018 07:42:38 +0000
(09:42 +0200)
committer
Thierry Parmentelat
<thierry.parmentelat@inria.fr>
Sat, 26 May 2018 07:58:55 +0000
(09:58 +0200)
setup.py
patch
|
blob
|
history
sfa.spec
patch
|
blob
|
history
systemd/sfa-aggregate.service
patch
|
blob
|
history
systemd/sfa-db-init.sh
patch
|
blob
|
history
systemd/sfa-db.service
patch
|
blob
|
history
systemd/sfa-registry.service
patch
|
blob
|
history
diff --git
a/setup.py
b/setup.py
index
770dace
..
b168ec7
100755
(executable)
--- a/
setup.py
+++ b/
setup.py
@@
-88,14
+88,6
@@
data_files = [
]
]
-initscripts = [ 'sfa' ]
-if not os.path.isfile('/etc/redhat-release'):
- initscripts.append('functions.sfa')
-data_files.append(
- ('/etc/init.d/',
- [ "init.d/%s"%x for x in initscripts ]))
-
-
services = ['sfa-db', 'sfa-aggregate', 'sfa-registry']
data_files.append(
('/usr/lib/systemd/system',
services = ['sfa-db', 'sfa-aggregate', 'sfa-registry']
data_files.append(
('/usr/lib/systemd/system',
@@
-122,8
+114,6
@@
if sys.argv[1] in ['uninstall', 'remove', 'delete', 'clean']:
remove_dirs = ['/etc/sfa/', '/etc/sfatables'] + site_packages_path
remove_bins = [ '/usr/bin/' + os.path.basename(bin) for bin in scripts ]
remove_files = (remove_bins
remove_dirs = ['/etc/sfa/', '/etc/sfatables'] + site_packages_path
remove_bins = [ '/usr/bin/' + os.path.basename(bin) for bin in scripts ]
remove_files = (remove_bins
- + ["/etc/init.d/{}}".format(x)
- for x in initscripts ]
+ ["/usr/lib/systemd/system/{}".format(x)
for x in services])
+ ["/usr/lib/systemd/system/{}".format(x)
for x in services])
diff --git
a/sfa.spec
b/sfa.spec
index
71870ed
..
b778da7
100644
(file)
--- a/
sfa.spec
+++ b/
sfa.spec
@@
-150,7
+150,6
@@
make VERSIONTAG="%{version}-%{taglevel}" SCMURL="%{SCMURL}" install DESTDIR="$RP
rm -rf $RPM_BUILD_ROOT
%files
rm -rf $RPM_BUILD_ROOT
%files
-/etc/init.d/sfa
/usr/lib/systemd/system/*.service
%{_bindir}/sfa-start.py*
%{_bindir}/sfaadmin.py*
/usr/lib/systemd/system/*.service
%{_bindir}/sfa-start.py*
%{_bindir}/sfaadmin.py*
diff --git
a/systemd/sfa-aggregate.service
b/systemd/sfa-aggregate.service
index
1174bb7
..
497c860
100644
(file)
--- a/
systemd/sfa-aggregate.service
+++ b/
systemd/sfa-aggregate.service
@@
-1,12
+1,10
@@
-# this is meant to be installed under /etc/systemd/system
[Unit]
Description=SFA Aggregate Manager (AM)
[Unit]
Description=SFA Aggregate Manager (AM)
+Requires=sfa-db
+After=sfa-db
[Service]
[Service]
-#Environment=PYTHONPATH=/root/nbhosting/nbhosting
ExecStart=/bin/bash -c "/usr/bin/sfa-start.py -a"
ExecStart=/bin/bash -c "/usr/bin/sfa-start.py -a"
-Requires=sfa-db
-After=sfa-db
[Install]
WantedBy=multi-user.target
[Install]
WantedBy=multi-user.target
diff --git
a/systemd/sfa-db-init.sh
b/systemd/sfa-db-init.sh
index
1a030fd
..
f28d7bd
100755
(executable)
--- a/
systemd/sfa-db-init.sh
+++ b/
systemd/sfa-db-init.sh
@@
-18,12
+18,6
@@
sfa_local_config=/etc/sfa/configs/site_config
sfa_local_config_xml=/etc/sfa/configs/site_config.xml
sfa_local_config_sh=/etc/sfa/sfa_config.sh
sfa_local_config_xml=/etc/sfa/configs/site_config.xml
sfa_local_config_sh=/etc/sfa/sfa_config.sh
-# source shell config if present; might not be the very first time
-[ -f $sfa_local_config_sh ] && source $sfa_local_config_sh
-
-# Export so that we do not have to specify -p to psql invocations
-export PGPORT=$SFA_DB_PORT
-
# Regenerate configuration files - almost verbatim from plc.init
function reconfigure () {
# Regenerate configuration files - almost verbatim from plc.init
function reconfigure () {
@@
-108,7
+102,7
@@
function start () {
echo "local all all trust" >> $pg_hba_conf
# Disable access to our DB from all hosts
echo "local all all trust" >> $pg_hba_conf
# Disable access to our DB from all hosts
- sed -i -e "/^host ${SFA_DB_NAME}/d
'
$pg_hba_conf
+ sed -i -e "/^host ${SFA_DB_NAME}/d
"
$pg_hba_conf
# grant access
{
echo "host $SFA_DB_NAME $SFA_DB_USER 127.0.0.1/32 password"
# grant access
{
echo "host $SFA_DB_NAME $SFA_DB_USER 127.0.0.1/32 password"
@@
-145,4
+139,13
@@
function start () {
}
}
+# source shell config if present
+# but it might not be present the very first time
+[ ! -f $sfa_local_config_sh ] && reconfigure
+
+source $sfa_local_config_sh
+
+# Export so that we do not have to specify -p to psql invocations
+export PGPORT=$SFA_DB_PORT
+
start
start
diff --git
a/systemd/sfa-db.service
b/systemd/sfa-db.service
index
f2d7d2c
..
7ad798e
100644
(file)
--- a/
systemd/sfa-db.service
+++ b/
systemd/sfa-db.service
@@
-1,6
+1,7
@@
[Unit]
Description=SFA Database service
[Unit]
Description=SFA Database service
-#After=network.target
+Requires=postgresql
+After=postgresql
[Service]
Type=oneshot
[Service]
Type=oneshot
@@
-10,8
+11,6
@@
RemainAfterExit=true
# that does not seem useful in our case
ExecStop=/bin/true
StandardOutput=journal
# that does not seem useful in our case
ExecStop=/bin/true
StandardOutput=journal
-Requires=postgresql
-After=postgresql
[Install]
WantedBy=multi-user.target
[Install]
WantedBy=multi-user.target
diff --git
a/systemd/sfa-registry.service
b/systemd/sfa-registry.service
index
fec12f5
..
e87af52
100644
(file)
--- a/
systemd/sfa-registry.service
+++ b/
systemd/sfa-registry.service
@@
-1,12
+1,11
@@
# this is meant to be installed under /etc/systemd/system
[Unit]
Description=SFA Registry Service
# this is meant to be installed under /etc/systemd/system
[Unit]
Description=SFA Registry Service
+Requires=sfa-db
+After=sfa-db
[Service]
[Service]
-#Environment=PYTHONPATH=/root/nbhosting/nbhosting
ExecStart=/bin/bash -c "/usr/bin/sfa-start.py -r"
ExecStart=/bin/bash -c "/usr/bin/sfa-start.py -r"
-Requires=sfa-db
-After=sfa-db
[Install]
WantedBy=multi-user.target
[Install]
WantedBy=multi-user.target