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

Ubuntu 14.04 webhook init fails #105

Closed
MarsuperMammal opened this issue Nov 26, 2014 · 9 comments
Closed

Ubuntu 14.04 webhook init fails #105

MarsuperMammal opened this issue Nov 26, 2014 · 9 comments

Comments

@MarsuperMammal
Copy link
Contributor

When running the PE master and r10k on Ubuntu 14.04 the webhook init script will fail.

Line's 17/18 of the erb template include

Source function library.

. /etc/rc.d/init.d/functions

Is it sufficient to ln -s /lib/lsb/functions to /etc/rc.d/init.d/functions? This appears to allow the code to execute, but I'm not sure it is functionally equivalent.

It might be worth stating that the daemon package has to be installed through apt-get in order to run this code without error as well.

@elyscape
Copy link
Contributor

The functions in Ubuntu's /lib/lsb/functions are not necessarily the same as those in RedHat's /etc/rc.d/init.d/functions. As per this Stack Exchange answer:

It's specific to whatever distribution you're running. Debian and Ubuntu have /lib/lsb/init-functions; SuSE has /etc/rc.status; none of them are compatible with the others. In fact, some distributions don't use /etc/init.d at all, or use it in an incompatible way (Slackware and Arch occur to me off the top of my head; there are others).

So yeah, it would probably be a good idea to implement the webhook in a more platform-independent manner.

@elyscape
Copy link
Contributor

Here's the relevant file, by the way.

@MarsuperMammal
Copy link
Contributor Author

Further inspection leads me to the point where it seems the web hook is entirely unsupported on Ubuntu. I may spend a bit of time trying to replicate enough functionality, but I'm not positive I grok it enough to get to the PR stage.

@acidprime
Copy link
Collaborator

@te206676 If you manage to get a working init script please post it here and I will test and get it merged int he code if you don;t have time for PR. We mostly deploy this to EL environments but I will def add support for Debian style OSs if there is a need.

@MarsuperMammal
Copy link
Contributor Author

@acidprime Taking a look at it presently, and as far as the init functions go, the only issues are the format of calling the pid file in start and stop methods, being -p= instead of -p. Presently I haven't figured out what the state of the status function is, or really understood it's purpose.

I'll keep digging to see what all needs to be altered for testing in my environment.

@elyscape
Copy link
Contributor

I'll do some work this weekend, probably, on making this a portable solution. It looks like porting it to the old System V init.d systems would make it supported basically everywhere, as both upstart and systemd support those scripts, so that's where I'll start.

@MarsuperMammal
Copy link
Contributor Author

Ok, I'm having my own little adventure trying to figure out what is happening in our environment relative to this module. We've always had issues with it working completely, including when our Puppet masters were on OEL 6.5. Right now I'm getting an education in Webrick and SSL, but hopefully after that I'll be back on track.

@MarsuperMammal
Copy link
Contributor Author

In very early stages it seems to have been simple to get functionality running, once I looked closely into what was going on.

Source function library.

. /lib/lsb/init-functions

start() {
echo
echo -n $"Starting webhook: "
daemon --user ${DAEMON_USER:?} --pidfile=$pidfile $webhook

Either create a sym link between /lib/lsb/init-functions and /etc/rc.d/init.d/functions or alter that line, then change the space to an = in the start command.

@acidprime
Copy link
Collaborator

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

3 participants