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 Logging #89

Closed
askmike1 opened this issue Dec 17, 2016 · 5 comments
Closed

Service Logging #89

askmike1 opened this issue Dec 17, 2016 · 5 comments

Comments

@askmike1
Copy link

Is there a way to have the system service (/etc/init.d/vault) send its output to a log file?

@legal90
Copy link
Contributor

legal90 commented Dec 17, 2016

@askmike1
Copy link
Author

Interesting, it doesn't seem to be logging there for me by default. In fact my /etc/init.d/vault script looks more like the following:

#!/bin/sh
# Init script for vault generated by poise-service
#
### BEGIN INIT INFO
# Provides: vault
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Init script for vault
# Description: Init script for vault
### END INIT INFO
``
_start() {
` /opt/chef/embedded/bin/ruby <<EOH`
`require 'etc'`
`pid_file = "/var/run/vault.pid"`
`File.unlink(pid_file) if File.exist?(pid_file)`
`if Process.fork`
` sleep(1) until File.exist?(pid_file)`
`else`
` Process.daemon(true)`
` Dir.chdir("/var/run/vault")`
` IO.write(pid_file, Process.pid)`
` ent = Etc.getpwnam("consul")`
` if Process.euid != ent.uid || Process.egid != ent.gid`
` Process.initgroups(ent.name, ent.gid)`
` Process::GID.change_privilege(ent.gid) if Process.egid != ent.gid`
` Process::UID.change_privilege(ent.uid) if Process.euid != ent.uid`
` end`
` Kernel.exec(*["/opt/vault/0.6.4/vault", "server", "-config=/etc/vault/vault.json"])`
` exit!`
`end`
`EOH`
`}`

@legal90
Copy link
Contributor

legal90 commented Dec 17, 2016

@askmike1 What hashicorp-vault cookbook version do you use?
The custom template for sysvinit provider has been added in v2.4.0 (#51)

@askmike1
Copy link
Author

Wow, didn't even realize I was on an older version of the cookbook... thanks!

@lock
Copy link

lock bot commented May 19, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants