質問編集履歴
1
m6u 様,yukky1201 様よりご返信頂いた内容を追記致しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -123,3 +123,77 @@
|
|
123
123
|
|
124
124
|
|
125
125
|
申し訳ありませんが、アドバイスを頂けないでしょうか?
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
### 追記
|
130
|
+
|
131
|
+
1955にて、使用したいサービスは自作スクリプトです。
|
132
|
+
|
133
|
+
以下のコマンドよりサービスの起動を試みた状態での結果です。
|
134
|
+
|
135
|
+
```ここに言語を入力
|
136
|
+
|
137
|
+
サービスの有効化で行ったコマンド
|
138
|
+
|
139
|
+
[root@xxx ~]# vi /etc/systemd/system/myscript.service
|
140
|
+
|
141
|
+
[Unit]
|
142
|
+
|
143
|
+
Description = myscript daemon
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
[Service]
|
148
|
+
|
149
|
+
ExecStart = /home/user/myscript/myscript
|
150
|
+
|
151
|
+
Restart = always
|
152
|
+
|
153
|
+
Type = simple
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
[Install]
|
158
|
+
|
159
|
+
WantedBy = multi-user.target
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
[root@xxx ~]# systemctl enable myscript.service
|
164
|
+
|
165
|
+
Created symlink from /etc/systemd/system/multi-user.target.wants/myscript.service to /etc/systemd/system/myscript.service.
|
166
|
+
|
167
|
+
[root@xxx ~]# systemctl start myscript.service
|
168
|
+
|
169
|
+
[root@xxx ~]# systemctl list-unit-files --type=service | grep myscript
|
170
|
+
|
171
|
+
myscript.service enabled
|
172
|
+
|
173
|
+
[root@xxx ~]# systemctl status myscript.service
|
174
|
+
|
175
|
+
● myscript.service - myscript daemon
|
176
|
+
|
177
|
+
Loaded: loaded (/etc/systemd/system/myscript.service; enabled; vendor preset: disabled)
|
178
|
+
|
179
|
+
Active: active (running) since 火 2019-07-02 22:02:40 JST; 4s ago
|
180
|
+
|
181
|
+
Main PID: 26277 (myscript)
|
182
|
+
|
183
|
+
CGroup: /system.slice/myscript.service
|
184
|
+
|
185
|
+
└─26277 /home/user/myscript/myscript
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
7月 02 22:02:40 xxx systemd[1]: myscript.service holdoff time over, scheduli...t.
|
190
|
+
|
191
|
+
7月 02 22:02:40 xxx systemd[1]: Started myscript daemon.
|
192
|
+
|
193
|
+
7月 02 22:02:40 xxx systemd[1]: Starting myscript daemon...
|
194
|
+
|
195
|
+
Hint: Some lines were ellipsized, use -l to show in full.
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
```
|