-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.user_data
More file actions
49 lines (46 loc) · 1.41 KB
/
Copy pathexample.user_data
File metadata and controls
49 lines (46 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
#
# This is the example user_data template file for testing a new or
# upgraded installation of Vac, as described in the Vac Admin Guide.
# See http://www.gridpp.ac.uk/vac/ for the guide and more about Vac.
#
# Inside the VM, the user_data script section creates a file in
# the machineoutputs directory, waits 5 minutes, then shuts down
# the VM.
#
# In the [machinetype example] section of your /etc/vac.conf you must
# include this option to tell the VMs where the proxy cache that
# you use for cvmfs is located:
#
# user_data_option_cvmfs_proxy = http://YOUR.HTTP.PROXY:PORT
#
# All other ##user_data__## sustitutions for this template are
# generated automatically by Vac.
#
# Andrew.McNab@cern.ch August 2017
#
# Set the hostname if available; display otherwise
hostname ##user_data_machine_hostname##
mkdir -p /var/spool/joboutputs
# Create the epilog.sh which is run at the end of set up
# within the CernVM virtual machine
cat <<EP_EOF >>/var/lib/hepix/context/epilog.sh
#!/bin/sh
(
echo 'Created by example user_data' > /var/spool/joboutputs/example.txt
sleep 300
/sbin/shutdown -h now 'VM shutting down ...'
sleep 1234567890
) > /var/spool/joboutputs/example.log 2>&1
EP_EOF
chmod +x /var/lib/hepix/context/epilog.sh
exit 0
[amiconfig]
plugins=cernvm
[cernvm]
repositories = grid
proxy=##user_data_option_cvmfs_proxy##
[ucernvm-begin]
resize_rootfs=off
cvmfs_http_proxy=##user_data_option_cvmfs_proxy##
[ucernvm-end]