Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to install openrc in docker-alpine? #15

Closed
snowdream opened this issue Jun 4, 2019 · 4 comments
Closed

how to install openrc in docker-alpine? #15

snowdream opened this issue Jun 4, 2019 · 4 comments

Comments

@snowdream
Copy link

i want to install openrc in docker-alpine and run frpc as service.

/run/openrc # rc-service frpc start
/lib/rc/sh/openrc-run.sh: line 101: can't create /sys/fs/cgroup/blkio/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 101: can't create /sys/fs/cgroup/cpu/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 101: can't create /sys/fs/cgroup/cpuacct/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 101: can't create /sys/fs/cgroup/cpuset/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 101: can't create /sys/fs/cgroup/devices/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 101: can't create /sys/fs/cgroup/freezer/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 101: can't create /sys/fs/cgroup/hugetlb/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 101: can't create /sys/fs/cgroup/memory/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 101: can't create /sys/fs/cgroup/net_cls/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 101: can't create /sys/fs/cgroup/net_prio/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 101: can't create /sys/fs/cgroup/perf_event/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 101: can't create /sys/fs/cgroup/pids/tasks: Read-only file system
/lib/rc/sh/openrc-run.sh: line 101: can't create /sys/fs/cgroup/systemd/tasks: Read-only file system
 * You are attempting to run an openrc service on a
 * system which openrc did not boot.
 * You may be inside a chroot or you may have used
 * another initialization system to boot this system.
 * In this situation, you will get unpredictable results!
 * If you really want to do this, issue the following command:
 * touch /run/openrc/softlevel
 * ERROR: networking failed to start
 * ERROR: cannot start frpc as networking would not start

frpc service:

#!/sbin/openrc-run
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

pidfile="/run/frpc.pid"
configfile="/etc/frp/frpc.ini"
command="/usr/bin/frpc"
command_opts=" -c $configfile"

depend() {
    need net
    need localmount
}

start() {
    ebegin "Starting frpc"
    start-stop-daemon --start --background \
    --exec $command \
    -- $command_opts \
    --make-pidfile --pidfile $pidfile
    eend $?
}

stop() {
    ebegin "Stopping frpc"
    start-stop-daemon --stop \
    --exec $command \
    --pidfile $pidfile
    eend $?
}

reload() {
    ebegin "Reloading frpc"
    start-stop-daemon --exec $command \
    --pidfile $pidfile \
    -s 1
    eend $?
}
@snowdream
Copy link
Author

@ncopa
Copy link
Contributor

ncopa commented Aug 13, 2019

You normally dont run openrc in a docker container.

If you only need to know how to install it: apk add openrc.

If you intend to run it in docker conatiner, then this comment may be helpful: gliderlabs/docker-alpine#437 (comment)

In either case, this is not an issue that we (alpine) can fix in the docker image.

@ncopa ncopa closed this as completed Aug 13, 2019
@urbantom
Copy link

Guys, isn't this: Setting up a ssh-server your wiki? If it is, how can you say normally don't run openrc in a docker container?

@domibay-hugo
Copy link

I found I cannot enable Secondary Services at Build Time

RUN rc-update add rsyslog default\
  && mkdir /run/openrc\
  && touch /run/openrc/softlevel\
  && rc-service rsyslog start

Just to run rc-service <secondary_service> start does not work!

So I figured out this Workaround
Secondary Services Workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants