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

sessionclean script stop working after upgrading 5.5.15+dfsg-1 --> 5.5.15+dfsg-2 #8

Closed
BahnhofMS opened this issue Aug 19, 2014 · 7 comments

Comments

@BahnhofMS
Copy link

This was due to the server defaulting to dash, when scripts begin with

!/bin/sh. With dash, output of echo differs in that flags suddenly aren't flags, as such:

$ echo -e
-e

Changing line 8 in /usr/lib/php5/sessionclean to instead use the echo binary:
/bin/echo -e "$SAPIS" |
seems to fix it.

@oerdnj
Copy link
Owner

oerdnj commented Aug 19, 2014

Or just leave the -e;

I have already noticed this and fix is on it's way...

@oerdnj oerdnj closed this as completed Aug 19, 2014
@BahnhofMS
Copy link
Author

If -e is left out it will break on bash instead, causing read to only process the first entry in "$SAPIS"

@oerdnj
Copy link
Owner

oerdnj commented Aug 20, 2014

The default shell in Debian and Ubuntu is dash. Is there a way how to reproduce it in real life deployment?

@BahnhofMS
Copy link
Author

Fair point, but since the default is still a configuration option that can be changed, we should probably aim to keep "#!/bin/sh"-scripts portable.

We should use:
printf "%b\n" "$SAPIS" | \
...according to https://wiki.ubuntu.com/DashAsBinSh#echo
and http://www.unix.com/man-page/POSIX/1posix/echo/

@oerdnj
Copy link
Owner

oerdnj commented Aug 20, 2014

Thanks for the tip, I have modified the script and it will included in next upload to the PPAs (and Debian)...

SAPIS="apache2:apache2\napache2filter:apache2\ncgi:php5\nfpm:php5-fpm\n"
[...]
printf "$SAPIS" | \

@BahnhofMS
Copy link
Author

(Np, I should be thanging you for the work maintaining this. ^_^ Donation is on my todo, btw).
Personally I wouldn't skip "%b\n" and risk silently ignore the last tuple because of a missing final \n. But either way is ok.

@oerdnj
Copy link
Owner

oerdnj commented Aug 21, 2014

Re: "%b\n"

I plan to rewrite that little bit more... see my discussion with Steve here: https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1356113

P.S.: I now have a bitcoin address too :)

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

2 participants