Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Automatic systemd daemon-reload
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
armills
n00b
n00b


Joined: 31 Jan 2012
Posts: 6

PostPosted: Thu Jan 12, 2017 3:05 pm    Post subject: Automatic systemd daemon-reload Reply with quote

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
View user's profile Send private message
littletux
n00b
n00b


Joined: 08 Dec 2003
Posts: 74

PostPosted: Tue Mar 21, 2017 11:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
Marlo
Veteran
Veteran


Joined: 26 Jul 2003
Posts: 1591

PostPosted: Mon Nov 06, 2017 5:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
archenroot
Apprentice
Apprentice


Joined: 13 Dec 2011
Posts: 218
Location: Lake Macha, Czech republic

PostPosted: Wed Nov 08, 2017 7:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
Marlo
Veteran
Veteran


Joined: 26 Jul 2003
Posts: 1591

PostPosted: Wed Nov 08, 2017 9:25 pm    Post subject: Reply with quote

thank you, Hu
_________________
------------------------------------------------------------------
http://radio.garden/
Back to top
View user's profile Send private message
archenroot
Apprentice
Apprentice


Joined: 13 Dec 2011
Posts: 218
Location: Lake Macha, Czech republic

PostPosted: Thu Dec 07, 2017 3:19 pm    Post subject: Reply with quote

Any resolution for this? I need to detect architecture in my ebuild, so I do:
Code:
ARCH=$(uname -m)


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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22730

PostPosted: Fri Dec 08, 2017 2:04 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
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