Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 180799 - app-admin/webapp-config - Extend the capabilites of hook scripts by ebuild functionality
Summary: app-admin/webapp-config - Extend the capabilites of hook scripts by ebuild fu...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Web Application Packages Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-03 23:05 UTC by Elias Probst
Modified: 2007-11-09 19:18 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elias Probst 2007-06-03 23:05:31 UTC
It would be really nice to be able to use ebuild functions in hook scripts of webapp-config. Some examples concerning OTRS which im working currently on:

- Use enew{user,group} for creating an user for OTRS' cronjobs
- Detect usage of unicode useflag to enable UTF-8 when creating the webapp-instance
- Have prettier output/error handling in hook scripts ... currently I'm sourcing /etc/init.d/functions.sh for this
- .... much more... I think we'll start loving it, as soon as it's available for hook scripts ;-)

Currently the hooks are running inside a sandbox, but there aren't any proper "workarounds" for doing operations like provided by all the do* functions in ebuilds etc.

Thank you!
Comment 1 Gunnar Wrobel (RETIRED) gentoo-dev 2007-11-09 17:21:25 UTC
(In reply to comment #0)
> It would be really nice to be able to use ebuild functions in hook scripts of
> webapp-config. Some examples concerning OTRS which im working currently on:
> 
> - Use enew{user,group} for creating an user for OTRS' cronjobs

This should usually not happen during the webapp-config run. webapp-config is mainly meant to install the htdocs and should not be really involved in system specific tasks.

In case of otrs I assume it might also be sufficient to create the users in the ebuild phase. Or is there a specific reason for disallowing that?

> - Detect usage of unicode useflag to enable UTF-8 when creating the
> webapp-instance

What is the specific action required by webapp-config if the unicode USE-Flag is activated? Is this something that may also be handled in the ebuild phase? After all USE-Flags are specifically meant for emerge and porting the concept to webapp-config will be difficult.

> - Have prettier output/error handling in hook scripts ... currently I'm
> sourcing /etc/init.d/functions.sh for this

I don't see a real problem with sourcing /etc/init.d/functions.sh. On the other hand hook scripts are meant to do really small, minor jobs required when setting up a webapp. They should not be extremely complex because that means that there is a higher chance for failure.

> - .... much more... I think we'll start loving it, as soon as it's available
> for hook scripts ;-)
> 
> Currently the hooks are running inside a sandbox, but there aren't any proper
> "workarounds" for doing operations like provided by all the do* functions in
> ebuilds etc.

That is intentional. A hook script will never do anything OUTSIDE of this sandbox. If anything system-critical has to be done, it has to be handled by webapp-config.

> 
> Thank you!
> 

Comment 2 Elias Probst 2007-11-09 19:18:39 UTC
(In reply to comment #1)
> This should usually not happen during the webapp-config run. webapp-config is
> mainly meant to install the htdocs and should not be really involved in system
> specific tasks.
I've always dreamed of 'webapps' being a subclass of ebuilds... but realization of my dreams seems to be far far away ;-)

> In case of otrs I assume it might also be sufficient to create the users in the
> ebuild phase. Or is there a specific reason for disallowing that?
This won't work, because every instance of OTRS needs an own user with it's own cronjobs and permissions. Predicting the needed users when running the ebuild is impossible, unless we add the clairvoyant() function to ebuilds ;-)

> > - Detect usage of unicode useflag to enable UTF-8 when creating the
> > webapp-instance
> 
> What is the specific action required by webapp-config if the unicode USE-Flag
> is activated? Is this something that may also be handled in the ebuild phase?
> After all USE-Flags are specifically meant for emerge and porting the concept
> to webapp-config will be difficult.

This could probably be done in the ebuild. It defines the default encoding for database, logfiles, notification mails, HTML output etc. based on the unicode USE-Flag when setting up a new instance.

> I don't see a real problem with sourcing /etc/init.d/functions.sh. On the other
> hand hook scripts are meant to do really small, minor jobs required when
> setting up a webapp. They should not be extremely complex because that means
> that there is a higher chance for failure.

I know about that, but all this workarounds made the whole process extremely complex. I added a lot of checks to the scripts to prevent eventual failures.

> That is intentional. A hook script will never do anything OUTSIDE of this
> sandbox. If anything system-critical has to be done, it has to be handled by
> webapp-config.
Yeah, thats correct. But when there's a function not available due to restrictions of the sandbox, a function for doing this while being watched by the sandbox should be available to for essential operations (compare enewuser/enewgroup in ebuilds).

Regards, Elias P.