Conversation
Include script header after type specific scriptlet to ensure type specific shebang is used. Fixes: 19ccbed ("Adjusted detection of systemd in package scriptlets to handle more valid states")
|
Thank you for submitting a PR! Maybe @craigcomstock can review this? |
|
@btriller thanks for the contribution, can you describe where and how you saw this as a problem? Thanks! |
Debian Trixie/CFEngine Community 3.27.0 |
|
I didn't dig deeper but we have some hosts that didn't have |
|
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=622094 |
craigcomstock
left a comment
There was a problem hiding this comment.
I still don't see any mention of how the as-is code causes a problem. It would be good to mention what caused you to work on this change in the first place. I assume there was a problem you encountered?
| # action = <install|remove> | ||
| # | ||
| # script-header.sh | ||
| # <type>-script-common.sh |
There was a problem hiding this comment.
The -script-common.sh relies on use_systemd function in script-header.sh so this change will break things I think.
Rather the fix might be to put the shebang at the top of script-header.sh and leave the order as-is.
Only bff-script-common.sh does not use /bin/sh but rather /usr/bin/ksh so that would need refactoring as well.
There was a problem hiding this comment.
But use_systemd is only used after script-header.sh?
% sh -x <<endofscript
\`heredoc> func1() {
\`heredoc> func2
\`heredoc> }
\`heredoc>
\`heredoc> func2() {
\`heredoc> echo func2
\`heredoc> }
\`heredoc>
\`heredoc> func1
\`heredoc> endofscript
+ func1
+ func2
+ echo func2
func2
There was a problem hiding this comment.
I will double check this situation. Thanks!
My issue arises from installing cfengine-community package in Debian installer. It isn't running under |
Perfect! So not working with debian sysvinit? That's something we can test and know is resolved. I will try it out and log a ticket if I can reproduce (I bet I can!). |
I switched a default debian-12 instance to sysvinit, rebooted, installed the recent nightly community package and bootstrapped. all seems well. Can you describe the problem another way? I tried running update-rc.d cfengine3 defaults manually after all was well and I see plenty of symlinks to start/stop cfengine3 service at various run levels. Are you saying that after install you have no rcN.d symlinks for cfengine3? I will try the install again later and check the state after install to make sure our postinst scripts are working properly. And, yes, I agree that our shebangs should be at the top of our scriptlets... so some change is needed! Thanks for the contribution/notice! |
Include script header after type specific scriptlet to ensure type specific shebang is used.
Fixes: 19ccbed ("Adjusted detection of systemd in package scriptlets to handle more valid states")