View previous topic :: View next topic |
Author |
Message |
armills n00b
Joined: 31 Jan 2012 Posts: 6
|
Posted: Thu Jan 12, 2017 3:05 pm Post subject: Automatic systemd daemon-reload |
|
|
Just wanted to share my latest snippet from /etc/portage/bashrc. Saves me from constantly forgetting to reload after updates.
Code: | if [ "${EBUILD_PHASE}" == "postinst" ] && \
equery files "${CATEGORY}/${PN}" | \
grep -q '^/usr/lib/systemd/system/.*\.service$' ; then
einfo "Reloading systemd daemons"
systemctl daemon-reload
fi |
|
|
Back to top |
|
|
littletux n00b
Joined: 08 Dec 2003 Posts: 74
|
Posted: Tue Mar 21, 2017 11:49 pm Post subject: |
|
|
Why you not use the automated reload mechanism from systemd?
you can copy the original systemd file associated with (your_needed_service) from /usr/lib/systemd/system/(your_needed_service) to /etc/systemd/system/(your_needed_service)
Then under the [Service] section in the file you have to add the following 2 lines:
Code: |
Restart=always
RestartSec=3
|
and then either restart your Computer or do
Code: |
systemctl daemon-reload
systemctl restart (your_needed_service) |
|
|
Back to top |
|
|
Marlo Veteran
Joined: 26 Jul 2003 Posts: 1591
|
Posted: Mon Nov 06, 2017 5:30 pm Post subject: |
|
|
The above lines in /etc/portage/bashrc show this result:
tux# emergeall: |
These are the packages that would be merged, in order:
Calculating dependencies | * QA Notice: 'equery' called in global scope: sys-devel/automake-1.15.1-r1
*** missing command: equery
* ERROR: sys-devel/automake-1.15.1-r1::gentoo failed (depend phase):
* External commands disallowed while sourcing ebuild:
*
* Call stack:
* ebuild.sh, line 596: Called __source_all_bashrcs
* ebuild.sh, line 421: Called __try_source '--no-qa' '/etc/portage/bashrc'
| * ebuild.sh, line 470: Called source '/etc/portage/bashrc'
* bashrc, line 2: Called command_not_found_handle ' '
* ebuild.sh, line 88: Called die
* The specific snippet of code:
* die "External commands disallowed while sourcing ebuild: ${*}"
*
* If you need support, post the output of `emerge --info '=sys-devel/automake-1.15.1-r1::gentoo'`,
* the complete build log and the output of `emerge -pqv '=sys-devel/automake-1.15.1-r1::gentoo'`.
* Working directory: '/usr/lib64/python3.4/site-packages'
* S: '/var/tmp/portage/sys-devel/automake-1.15.1-r1/work/automake-1.15.1'
- * QA Notice: 'equery' called in global scope: sys-devel/automake-1.11.6-r2
*** missing command: equery
* ERROR: sys-devel/automake-1.11.6-r2::gentoo failed (depend phase):
* External commands disallowed while sourcing ebuild:
*
/ * Call stack:
* ebuild.sh, line 596: Called __source_all_bashrcs
* ebuild.sh, line 421: Called __try_source '--no-qa' '/etc/portage/bashrc'
* ebuild.sh, line 470: Called source '/etc/portage/bashrc'
* bashrc, line 2: Called command_not_found_handle ' '
* ebuild.sh, line 88: Called die
* The specific snippet of code:
* die "External commands disallowed while sourcing ebuild: ${*}"
*
* If you need support, post the output of `emerge --info '=sys-devel/automake-1.11.6-r2::gentoo'`,
* the complete build log and the output of `emerge -pqv '=sys-devel/automake-1.11.6-r2::gentoo'`.
* Working directory: '/usr/lib64/python3.4/site-packages'
* S: '/var/tmp/portage/sys-devel/automake-1.11.6-r2/work/automake-1.11.6'
| * QA Notice: 'equery' called in global scope: app-text/poppler-0.57.0
*** missing command: equery
* ERROR: app-text/poppler-0.57.0::gentoo failed (depend phase):
* External commands disallowed while sourcing ebuild:
*
* Call stack:
/ * ebuild.sh, line 596: Called __source_all_bashrcs
* ebuild.sh, line 421: Called __try_source '--no-qa' '/etc/portage/bashrc'
* ebuild.sh, line 470: Called source '/etc/portage/bashrc'
* bashrc, line 2: Called command_not_found_handle ' '
* ebuild.sh, line 88: Called die
* The specific snippet of code:
* die "External commands disallowed while sourcing ebuild: ${*}"
*
* If you need support, post the output of `emerge --info '=app-text/poppler-0.57.0::gentoo'`,
* the complete build log and the output of `emerge -pqv '=app-text/poppler-0.57.0::gentoo'`.
* Working directory: '/usr/lib64/python3.4/site-packages'
* S: '/var/tmp/portage/app-text/poppler-0.57.0/work/poppler-0.57.0'
|... done!
Exiting on signal 2
|
[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu] _________________ ------------------------------------------------------------------
http://radio.garden/ |
|
Back to top |
|
|
archenroot Apprentice
Joined: 13 Dec 2011 Posts: 218 Location: Lake Macha, Czech republic
|
Posted: Wed Nov 08, 2017 7:34 pm Post subject: |
|
|
I also hit this error, but in different ebuild:
https://github.com/archenroot/gentoo-overlay/issues/27 _________________ Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force |
|
Back to top |
|
|
Marlo Veteran
Joined: 26 Jul 2003 Posts: 1591
|
Posted: Wed Nov 08, 2017 9:25 pm Post subject: |
|
|
thank you, Hu _________________ ------------------------------------------------------------------
http://radio.garden/ |
|
Back to top |
|
|
archenroot Apprentice
Joined: 13 Dec 2011 Posts: 218 Location: Lake Macha, Czech republic
|
Posted: Thu Dec 07, 2017 3:19 pm Post subject: |
|
|
Any resolution for this? I need to detect architecture in my ebuild, so I do:
Which causes this failure:
Code: | Calculating dependencies / * ERROR: app-editors/visual-studio-code-1.7.2::archenroot failed (depend phase):
* External commands disallowed while sourcing ebuild: uname -m
*
* Call stack:
* ebuild.sh, line 620: Called source '/var/lib/layman/archenroot/app-editors/visual-studio-code/visual-studio-code-1.7.2.ebuild'
* visual-studio-code-1.7.2.ebuild, line 36: Called command_not_found_handle 'uname' '-m'
* ebuild.sh, line 88: Called die
* The specific snippet of code:
* die "External commands disallowed while sourcing ebuild: ${*}"
*
* If you need support, post the output of `emerge --info '=app-editors/visual-studio-code-1.7.2::archenroot'`,
* the complete build log and the output of `emerge -pqv '=app-editors/visual-studio-code-1.7.2::archenroot'`.
* Working directory: '/usr/lib64/python2.7/site-packages'
* S: '/var/tmp/portage/app-editors/visual-studio-code-1.7.2/work/visual-studio-code-1.7.2'
... done!
!!! All ebuilds that could satisfy "app-editors/visual-studio-code" have been masked.
!!! One of the following masked packages is required to complete your request:
- app-editors/visual-studio-code-1.7.2::archenroot (masked by: corruption)
|
_________________ Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22753
|
Posted: Fri Dec 08, 2017 2:04 am Post subject: |
|
|
The resolution is not to do this. You should not be running external commands in this phase. Why do you need to detect the host architecture? In most cases, you want to care about the target architecture, which you cannot get during global scope because it is not yet known. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|