Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
padmwsverify
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
stw
wt
padmwsverify
Commits
790ca775
Commit
790ca775
authored
Feb 07, 2017
by
Tomas Pettersson
🏸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
timer and service
parent
4d4664fa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
138 additions
and
4 deletions
+138
-4
README.md
README.md
+2
-4
build/SMHI-padmwsverify.service
build/SMHI-padmwsverify.service
+6
-0
build/SMHI-padmwsverify.spec
build/SMHI-padmwsverify.spec
+120
-0
build/SMHI-padmwsverify.timer
build/SMHI-padmwsverify.timer
+10
-0
No files found.
README.md
View file @
790ca775
# padmrun
## Description
A tool used for running padm ws simulations. Used for monitoring and testing
# padmwsverify
A tool used for running padm web service simulations. Used for monitoring, testing and verification
## Installation
...
...
build/SMHI-padmwsverify.service
0 → 100644
View file @
790ca775
[Unit]
Description
=
SMHI-padmwsverify
[Service]
User
=
APPUSER
Type
=
oneshot
ExecStart
=
/local_disk/SMHI-padmwsverify/main.sh
\ No newline at end of file
build/SMHI-padmwsverify.spec
0 → 100644
View file @
790ca775
# Definition av filagare
%define AppOwner seatra
%define AppGroup seatrag
%define AppOwnerTst seatra.t
%define AppGroupTst seatragt
%define AppOwnerUtv seatra.u
%define AppGroupUtv seatragu
Summary: a Padmws runner used for monitoring, test and verification
Name: SMHI-padmwsverify
Version: %{version}
Release: %{release}
Packager: Tomas Pettersson <tomas.pettersson@smhi.se>
License: SMHI
Group: Applications/Webb/System
URL: http://www.smhi.se
Source: padmwsverify.tar
Source1: extras.zip
%description
%prep
%setup -c
%setup -T -D -a 1
%build
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system
mv $RPM_SOURCE_DIR/%{name}.service $RPM_BUILD_ROOT/usr/lib/systemd/system/%{name}.service
mv $RPM_SOURCE_DIR/%{name}.timer $RPM_BUILD_ROOT/usr/lib/systemd/system/%{name}.timer
mkdir -p $RPM_BUILD_ROOT/local_disk/%{name}
cp -a . $RPM_BUILD_ROOT/local_disk/%{name}
%pre
## Stop old version if this rpm is installed as an upgrade
if [ $1 -gt 1 ]; then
echo "Stopping existing %{name}"
/usr/bin/systemctl stop %{name}.timer
# Sleep just to be on the safe side
sleep 10
# Remove all but the logs directory
find /local_disk/%{name} -mindepth 1 -maxdepth 1 -depth -not -name logs -print0 | xargs -0 rm -rf
# Remove all log files older than 10 days
find /local_disk/%{name}/logs -type f -mtime +10 -print0 | xargs -0 rm -rf
fi
%post
source /etc/profile.d/smhi.sh
case "$SMHI_MODE" in
prod)
OWNER=%{AppOwner}
GROUP=%{AppGroup}
;;
test)
OWNER=%{AppOwnerTst}
GROUP=%{AppGroupTst}
;;
utv)
OWNER=%{AppOwnerUtv}
GROUP=%{AppGroupUtv}
;;
esac
# Sed unit file
/bin/sed -i "s/APPUSER/${OWNER}/" /usr/lib/systemd/system/%{name}.service
/bin/chown -R ${OWNER}:${GROUP} /local_disk/%{name}
if [ "$1" = "1" ] ; then # first install
#make app start and stop automatically on boot
/usr/bin/systemctl enable %{name}.timer
#start app on install
/usr/bin/systemctl start %{name}.timer
fi
if [ "$1" = "2" ] ; then # upgrade
#restart app on upgrade
/usr/bin/systemctl daemon-reload
/usr/bin/systemctl restart %{name}.timer
fi
%preun
## Stop old version if this rpm is being erased
if [ $1 -eq 0 ]; then
echo "Stopping existing %{name}"
/usr/bin/systemctl stop %{name}.timer
/usr/bin/systemctl disable %{name}.timer
/usr/bin/systemctl daemon-reload
sleep 10
fi
%postun
if [ $1 -eq 0 ] ; then # last uninstall
# Remove any old remaining stuff (tmp files, log files and whatnot)
rm -rf /local_disk/%{name}
fi
%clean
echo clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-, root, root, -)
/local_disk/%{name}
%attr(755,root,root) /usr/lib/systemd/system
%changelog
\ No newline at end of file
build/SMHI-padmwsverify.timer
0 → 100644
View file @
790ca775
[Unit]
Description=Runs SMHI-padmwsverify once an hour, 20 min past.
[Timer]
# Time to wait after booting before we run first time
OnBootSec=10min
# Time between running each consecutive time
OnCalendar=*:20
Unit=SMHI-padmwsverify
[Install]
WantedBy=multi-user.target
\ No newline at end of file
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