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

WIP: Add support for older sysv init as well #8572

Closed
wants to merge 1 commit into from

Conversation

afbjorklund
Copy link
Collaborator

@afbjorklund afbjorklund commented Jun 26, 2020

Not everything is Systemd or OpenRC yet

Previous code was assuming that everything non-systemd is openrc, which failed on some systems.

So look for OpenRC more explicitly, and add some generic fallback for the older SysV-like systems.

All supported minikube distributions are using Systemd, so this is mostly for the "none" driver...

Should test this on some alternative distributions, such as older Ubuntu/CentOS or maybe Devuan.

  • Ubuntu 14.04

  • CentOS 6

For #2704 and #6954

@afbjorklund afbjorklund requested a review from tstromberg June 26, 2020 18:42
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 26, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afbjorklund

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 26, 2020
Not everything is Systemd or OpenRC yet
Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we dont have integration test for this, is it possible to test this PR in systemd and init.d distro ot make sure we dont break the current cases? and put the output in the description ?

the cloud shell users need this for none driver

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Jun 26, 2020

since we dont have integration test for this, is it possible to test this PR in systemd and init.d distro ot make sure we dont break the current cases? and put the output in the description ?

the idea was that there should be no changes for users of systemd and openrc, i.e. all the currently covered sysinit

systemctl --version => systemd

openrc --version ==> openrc

what init system does cloud shell use ? I suppose we could do some even more basic fallback, if both redhat and debian fail

redhat: /etc/rc.d/init.d/functions

debian: /lib/lsb/init-functions

Also, the Enable seems to be totally unimplemented for OpenRC at the moment ? And we are hard-coding systemctl still:

pkg/minikube/cruntime/docker.go: rr, err := runner.RunCmd(exec.Command("sudo", "systemctl", "cat", "docker.service"))

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Jun 26, 2020

Also note that they are pretty identical (openrc.go and sysv.go), we mostly need to replace start-stop-daemon

https://wiki.alpinelinux.org/wiki/Writing_Init_Scripts

We're assuming here that the standard service wrapper is available, so we can do basic start|stop|restart|status

# /usr/bin/service
#
# A convenient wrapper for the /etc/init.d init scripts.
#
# This script is a modified version of the /sbin/service utility found on
# Red Hat/Fedora systems (licensed GPLv2+).

https://salsa.debian.org/debian/init-system-helpers/-/blob/master/script/service

Not to be confused with the rc-service program in openrc...

As used in for instance Alpine, and some other distributions:

/ # file /sbin/service 
/sbin/service: symbolic link to /sbin/rc-service
/ # file /sbin/rc-service 
/sbin/rc-service: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-x86_64.so.1, stripped

@afbjorklund afbjorklund changed the title Add support for older sysv init as well WIP: Add support for older sysv init as well Jun 26, 2020
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants