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
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
824f5786
Commit
824f5786
authored
May 24, 2012
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert from ntpd.sh (init script) to systemd. Thanks Ryan!
parent
71a3b830
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
97 deletions
+17
-97
clientside/tmcc/fedora15/GNUmakefile.in
clientside/tmcc/fedora15/GNUmakefile.in
+7
-1
clientside/tmcc/fedora15/ntpd
clientside/tmcc/fedora15/ntpd
+0
-96
clientside/tmcc/fedora15/ntpd.service
clientside/tmcc/fedora15/ntpd.service
+10
-0
No files found.
clientside/tmcc/fedora15/GNUmakefile.in
View file @
824f5786
...
...
@@ -37,6 +37,7 @@ VARDIR = $(DESTDIR)$(CLIENT_VARDIR)
RCDIR = $(SYSETCDIR)/rc.d
INSTALL = /usr/bin/install -c
COMMON = $(SRCDIR)/../common
DEFRUNLVLDIR = $(RCDIR)/rc3.d
install client-install: baselinux-client-install common-install etc-install \
sup-install script-install bin-install
...
...
@@ -82,15 +83,20 @@ etc-install: dir-install sysetc-remove sysetc-install
@echo "fedora-specific etc-install done"
sysetc-install: ifcfgs dir-install
# Clean up stuff from the base linux install. Ick.
# See ntpd.service below.
rm -f $(RCDIR)/init.d/ntpd
rm -f $(DEFRUNLVLDIR)/S58ntpd
ln -sf $(SYSETCDIR)/dhclient-enter-hooks $(SYSETCDIR)/dhcp/
ln -sf $(SYSETCDIR)/dhclient-exit-hooks $(SYSETCDIR)/dhcp/
$(INSTALL) -m 644 $(SRCDIR)/ntp.conf $(SYSETCDIR)/ntp.conf
$(INSTALL) -m 755 $(SRCDIR)/ntpd $(SYSETCDIR)/init.d/ntpd
$(INSTALL) -m 644 $(SRCDIR)/ifcfg-eth99 $(SYSETCDIR)/sysconfig/network-scripts
$(INSTALL) -m 644 ifcfg-eth[0-9]* $(SYSETCDIR)/sysconfig/network-scripts
$(INSTALL) -m 744 $(SRCDIR)/ifup-emulabcnet $(SYSETCDIR)/sysconfig/network-scripts
$(INSTALL) -m 644 $(SRCDIR)/emulab-fstab-fixup.service $(SYSETCDIR)/systemd/system
$(INSTALL) -m 644 $(SRCDIR)/ntpd.service $(SYSETCDIR)/systemd/system
systemctl enable emulab-fstab-fixup.service
systemctl enable ntpd.service
sysetc-remove:
rm -rf $(SYSETCDIR)/modules.conf $(SYSETCDIR)/ntp.conf $(SYSETCDIR)/cron.pend
...
...
clientside/tmcc/fedora15/ntpd
deleted
100755 → 0
View file @
71a3b830
#!/bin/bash
#
# ntpd This shell script takes care of starting and stopping
# ntpd (NTPv4 daemon).
#
# chkconfig: - 58 74
# description: ntpd is the NTPv4 daemon. \
# The Network Time Protocol (NTP) is used to synchronize the time of \
# a computer client or server to another server or reference time source, \
# such as a radio or satellite receiver or modem.
### BEGIN INIT INFO
# Provides: ntpd
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Should-Start: $syslog $named ntpdate
# Should-Stop: $syslog $named
# Short-Description: start and stop ntpd
# Description: ntpd is the NTPv4 daemon. The Network Time Protocol (NTP)
# is used to synchronize the time of a computer client or
# server to another server or reference time source, such
# as a radio or satellite receiver or modem.
### END INIT INFO
# Source function library.
.
/etc/init.d/functions
# Source networking configuration.
.
/etc/sysconfig/network
prog
=
ntpd
lockfile
=
/var/lock/subsys/
$prog
# Emulab changes
NTPD
=
$prog
if
[
-f
/etc/emulab/paths.sh
]
;
then
.
/etc/emulab/paths.sh
if
[
-x
$BINDIR
/ntpstart
]
;
then
NTPD
=
"--check ntpd
$BINDIR
/ntpstart /usr/sbin/ntpd"
;
fi
fi
start
()
{
[
"
$EUID
"
!=
"0"
]
&&
exit
4
[
"
$NETWORKING
"
=
"no"
]
&&
exit
1
[
-x
/usr/sbin/ntpd
]
||
exit
5
[
-f
/etc/sysconfig/ntpd
]
||
exit
6
.
/etc/sysconfig/ntpd
# Start daemon.
echo
-n
$"Starting
$prog
: "
daemon
$NTPD
-u
ntp:ntp
-p
/var/run/ntpd.pid
$OPTIONS
RETVAL
=
$?
echo
[
$RETVAL
-eq
0
]
&&
touch
$lockfile
return
$RETVAL
}
stop
()
{
[
"
$EUID
"
!=
"0"
]
&&
exit
4
echo
-n
$"Shutting down
$prog
: "
killproc
$prog
RETVAL
=
$?
echo
[
$RETVAL
-eq
0
]
&&
rm
-f
$lockfile
return
$RETVAL
}
# See how we were called.
case
"
$1
"
in
start
)
start
;;
stop
)
stop
;;
status
)
status
$prog
;;
restart|force-reload
)
stop
start
;;
try-restart|condrestart
)
if
status
$prog
>
/dev/null
;
then
stop
start
fi
;;
reload
)
exit
3
;;
*
)
echo
$"Usage:
$0
{start|stop|status|restart|try-restart|force-reload}"
exit
2
esac
clientside/tmcc/fedora15/ntpd.service
0 → 100644
View file @
824f5786
[Unit]
Description
=
Network Time Service
After
=
syslog.target ntpdate.service
[Service]
EnvironmentFile
=
/etc/sysconfig/ntpd
ExecStart
=
/bin/sh -c 'source /etc/emulab/paths.sh; exec $BINDIR/ntpstart /usr/sbin/ntpd -n -u ntp:ntp $OPTIONS'
[Install]
WantedBy
=
multi-user.target
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