diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-08-01 14:44:36 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-10-13 18:59:52 +0200 |
| commit | fc7735a27949755327024847e12dcc1b868bcb99 (patch) | |
| tree | 8f7ed16cdcc7a4cc34fd36c161f695d17ab9f632 /dashboard/config/freebsd | |
| parent | 5ba0ebc3f2626a1fd95bf1ce16e886ebc66d8638 (diff) | |
dashboard/config: move OS configs into separate dirs
There are too many assorted things in the config dir now.
Split them per-OS.
For now we just copy them to simplify deployment.
When syzbot instances are switched to new configs,
we can remove the old ones.
Update #2171
Diffstat (limited to 'dashboard/config/freebsd')
| -rwxr-xr-x | dashboard/config/freebsd/syz-ci-service.sh | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/dashboard/config/freebsd/syz-ci-service.sh b/dashboard/config/freebsd/syz-ci-service.sh new file mode 100755 index 000000000..26921d76b --- /dev/null +++ b/dashboard/config/freebsd/syz-ci-service.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# Copyright 2019 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +# To use: +# - place this script to /usr/local/etc/rc.d/syz_ci +# - chmod a+x /usr/local/etc/rc.d/syz_ci +# - add the following to /etc/rc.conf (uncommented): +# +# syz_ci_enable="YES" +# syz_ci_chdir="/syzkaller" +# syz_ci_flags="-config config-freebsd.ci" +# syz_ci_log="/syzkaller/syz-ci.log" +# syz_ci_path="/syzkaller/syz-ci" +# +# Then syz-ci will start after boot, to manually start/stop: +# service syz_ci stop +# service syz_ci start + +# PROVIDE: syz_ci +# REQUIRE: LOGIN + +. /etc/rc.subr + +command="${syz_ci_path}" +name="syz_ci" +pidfile="/var/run/${name}.pid" +rcvar="syz_ci_enable" +start_cmd="syz_ci_start" +stop_cmd="syz_ci_stop" + +# syz-ci needs to be able to find the go executable. +PATH=${PATH}:/usr/local/bin + +syz_ci_start() +{ + cd "${syz_ci_chdir}" + daemon -f -o "${syz_ci_log}" -p ${pidfile} "${syz_ci_path}" ${syz_ci_flags} +} + +syz_ci_stop() +{ + local _pid + + _pid=$(cat ${pidfile}) + kill -INT $_pid + [ $? -eq 0 ] || return 1 + pwait -t 120s $_pid +} + +load_rc_config $name +run_rc_command "$1" |
