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

service.enabled does not enable service in chroot environment for systemd #38751

Closed
geraldhansen opened this issue Jan 16, 2017 · 3 comments
Closed
Labels
info-needed waiting for more info stale
Milestone

Comments

@geraldhansen
Copy link

service.enabled just say service is already enabled, but the symlink in /etc/systemd/system/multi-user.target.wants/ is still missing.
I prepare a new system installation in a chroot environment which is a physical partition and can be enabled as the initial boot partition for the next reboot (Debian 8/Ubuntu 16.10).

Setup

In a chroot I run following state file test.sls:

install-apache:
    pkg.installed:
        - pkgs:
            - apache2

apache-service:
    service.enabled:
        - name: apache2
        - require:
            - pkg: install-apache

Steps to Reproduce Issue

salt-call state.sls test

[INFO    ] Executing state service.enabled for apache2
[INFO    ] Executing command ['systemctl', 'status', 'apache2.service', '-n', '0'] in directory '/home/gerald'
[DEBUG   ] output: * apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; generated; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           `-apache2-systemd.conf
   Active: inactive (dead) since Mon 2017-01-16 12:28:35 CET; 10min ago
     Docs: man:systemd-sysv-generator(8)
[INFO    ] Executing command ['systemctl', 'is-enabled', 'apache2.service'] in directory '/home/gerald'
[DEBUG   ] output: apache2.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install is-enabled apache2
enabled
[INFO    ] Service apache2 is already enabled, and is in the desired state
[INFO    ] Completed state [apache2] at time 12:38:49.468597 duration_in_ms=18.652

Versions Report

salt-call --versions-report
Salt Version:
           Salt: 2016.3.1
 
Dependency Versions:
           cffi: 1.7.0
       cherrypy: 3.5.0
       dateutil: 2.4.2
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.8
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: 2.14
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.12+ (default, Sep 17 2016, 12:08:02)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.2.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.4.2
            ZMQ: 4.2.0
 
System Versions:
           dist: Ubuntu 16.10 yakkety
        machine: x86_64
        release: 4.8.0-34-generic
         system: Linux
        version: Ubuntu 16.10 yakkety
@Ch3LL
Copy link
Contributor

Ch3LL commented Jan 18, 2017

@geraldhansen to confirm this isn't an issue with teh host can you manually run /lib/systemd/systemd-sysv-install is-enabled apache2 as it seems the minion is running and does that set it correctly?

@Ch3LL Ch3LL added the info-needed waiting for more info label Jan 18, 2017
@Ch3LL Ch3LL added this to the Blocked milestone Jan 18, 2017
@bdrung
Copy link
Contributor

bdrung commented May 29, 2017

systemd in Debian 8 (jessie) does not have systemd-sysv-install. Only Debian 9 (stretch) has it.

@stale
Copy link

stale bot commented Oct 28, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Oct 28, 2018
@stale stale bot closed this as completed Nov 4, 2018
waynew added a commit to dwoz/salt that referenced this issue Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed waiting for more info stale
Projects
None yet
Development

No branches or pull requests

3 participants