-
Notifications
You must be signed in to change notification settings - Fork 6
/
README
151 lines (88 loc) · 3.88 KB
/
README
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
Contains a Debian SysV style initialization script for a softioc using procServ.
= Usage =
This package uses the following files
/usr/bin/manage-iocs
/etc/init.d/softioc-*
/etc/default/epics-softioc
/epics/iocs/*/config
The following are provided as information.
/usr/share/doc/sysv-rc-softioc/config.example
/usr/share/doc/sysv-rc-softioc/README (this file)
== IOC runtime environment ==
The following environment variables are automatically set before procServ
is started. They may be overridden in the IOC shell.
IOCNAME - The IOC name.
USER - The system user account name which runs the IOC.
HOSTNAME - The short name of the host running the IOC.
TOP - The absolute path of the base IOC directory. Contains the 'config' file
EPICS_HOST_ARCH - Host target name (eg. linux-x86)
== manage-iocs ==
The script 'manage-iocs' has several sub-commands
to help in managing softiocs. See its manpage for
details.
$ manage-iocs help
Usage: manage-iocs [-v] [-x] cmd
Available commands:
help - display this message
report [ioc] - Show config of all/an IOC
status - Check if IOCs are running
nextport - Find the next unused procServ port
install <ioc> - Create /etc/init.d/softioc-[ioc]
enable <ioc> - Register IOC to start during system boot
disable <ioc> - Un-register IOC
== Initial Setup ==
1) Choose a location for softIoc instance data (st.cmd, db, ...).
This will be a single directory which will contain a subdirectory for each softIoc instance. A good choice would be '/epics/iocs'.
Set this path in '/etc/default/epics-softioc'.
$ cat /etc/default/epics-softioc
SOFTBASE=/epics/iocs
$
Note: Since version 1.3 SOFTBASE can be a ':' separated list of paths.
2) Create a Unix group softIocs
Each softIoc can run as a separate user. This provides a nice division and allows Channel Access security to distinguish all the instances on a given machine. It is recommended that all softIoc users be in the same group.
# groupadd softioc
3) Create the directory for softIoc instances
# mkdir /epics
# chgrp softioc /epics
# chmod g+s /epics
# mkdir /epics/iocs
# chmod g+ws /epics/iocs
4) (optional) Install Conserver
Conserver is a process which connects to the telnet servers provided by all the softIocs on a host. It then allows (secure) remote access and continuous logging.
# apt-get install conserver-server
Edit /etc/conserver/conserver.cf to include the following line.
default softioc { type host; host localhost;}
#include /etc/conserver/iocs.cf
See the conserver documentation for information on access control.
Note: Conserver uses the tcpd for authentication.
== Per-Instance Setup ==
1) Choose a name
Try to pick something more creative than example1 ;)
2) Create a user
# useradd -c 'softioc' -d /epics/iocs/example1 -g softioc -N example1
# mkdir /epics/iocs/example1
3) Configure the instance
Each instance must have a name and a port number (for procServ). It is also a good idea to include the server's hostname to prevent accidentally running it on the wrong server.
# cat << EOF > /epics/iocs/example1/config
NAME=example1
PORT=4051
HOST=myserver
EOF
Note: The manage-iocs script has a subcommand 'nextport' which tries to pick an unused port number from procServ.
If given, the hostname is required to match the result of running 'hostname -s' or 'hostname -f'.
See /usr/share/doc/sysv-rc-softioc-#/config.example for allowed items in a IOC config file.
# manage-iocs install example1
This creates/replaces the script /etc/init.d/softioc-example1
4) Add the softioc to the boot sequence
# manage-iocs enable example1
5) To remove from the boot sequence
# manage-iocs disable example1
6) (optional) Configure Conserver
After creating /epics/iocs/example1/config run:
# update-iocs-cf
7) Manually starting the instance
# /etc/init.d/softioc-example1 start
8) (optional) View console
$ console example1
9) (alternative) Direct telnet
$ telnet localhost 4051