What is âC sort orderâ in pm-action manpage? [duplicate]
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
This question already has an answer here:
What does âLC_ALL=Câ do?
5 answers
From manpage pm-action(8)
:
/etc/pm/sleep.d, /usr/lib/pm-utils/sleep.d
Programs in these directories (called hooks) are combined
and executed in C sort order before suspend and hibernate
with as argument ôsuspendô or ôhibernateô.
Afterwards they
are called in reverse order with argument ôresumeô and
ôthawô respectively.
If both directories contain a similar
named file, the one in/etc/pm/sleep.d
will get preference.
It is possible to disable a hook in the distribution
directory by putting a non-executable file in
/etc/pm/sleep.d
, or by adding it to theHOOK_BLACKLIST
configuration variable.
What is "C sort order"?
Does "a similar named file" mean two files with the same filename?
I have two files /usr/lib/pm-utils/sleep.d/94cpufreq
and /etc/pm/sleep.d/20_cpu_freq
.
When resume and thaw, which one is run first and which second?
Thanks.
power-management
marked as duplicate by muru, Jeff Schaller, Wouter Verhelst, Hauke Laging, Christopher Apr 4 at 13:34
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |Â
up vote
1
down vote
favorite
This question already has an answer here:
What does âLC_ALL=Câ do?
5 answers
From manpage pm-action(8)
:
/etc/pm/sleep.d, /usr/lib/pm-utils/sleep.d
Programs in these directories (called hooks) are combined
and executed in C sort order before suspend and hibernate
with as argument ôsuspendô or ôhibernateô.
Afterwards they
are called in reverse order with argument ôresumeô and
ôthawô respectively.
If both directories contain a similar
named file, the one in/etc/pm/sleep.d
will get preference.
It is possible to disable a hook in the distribution
directory by putting a non-executable file in
/etc/pm/sleep.d
, or by adding it to theHOOK_BLACKLIST
configuration variable.
What is "C sort order"?
Does "a similar named file" mean two files with the same filename?
I have two files /usr/lib/pm-utils/sleep.d/94cpufreq
and /etc/pm/sleep.d/20_cpu_freq
.
When resume and thaw, which one is run first and which second?
Thanks.
power-management
marked as duplicate by muru, Jeff Schaller, Wouter Verhelst, Hauke Laging, Christopher Apr 4 at 13:34
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
This question already has an answer here:
What does âLC_ALL=Câ do?
5 answers
From manpage pm-action(8)
:
/etc/pm/sleep.d, /usr/lib/pm-utils/sleep.d
Programs in these directories (called hooks) are combined
and executed in C sort order before suspend and hibernate
with as argument ôsuspendô or ôhibernateô.
Afterwards they
are called in reverse order with argument ôresumeô and
ôthawô respectively.
If both directories contain a similar
named file, the one in/etc/pm/sleep.d
will get preference.
It is possible to disable a hook in the distribution
directory by putting a non-executable file in
/etc/pm/sleep.d
, or by adding it to theHOOK_BLACKLIST
configuration variable.
What is "C sort order"?
Does "a similar named file" mean two files with the same filename?
I have two files /usr/lib/pm-utils/sleep.d/94cpufreq
and /etc/pm/sleep.d/20_cpu_freq
.
When resume and thaw, which one is run first and which second?
Thanks.
power-management
This question already has an answer here:
What does âLC_ALL=Câ do?
5 answers
From manpage pm-action(8)
:
/etc/pm/sleep.d, /usr/lib/pm-utils/sleep.d
Programs in these directories (called hooks) are combined
and executed in C sort order before suspend and hibernate
with as argument ôsuspendô or ôhibernateô.
Afterwards they
are called in reverse order with argument ôresumeô and
ôthawô respectively.
If both directories contain a similar
named file, the one in/etc/pm/sleep.d
will get preference.
It is possible to disable a hook in the distribution
directory by putting a non-executable file in
/etc/pm/sleep.d
, or by adding it to theHOOK_BLACKLIST
configuration variable.
What is "C sort order"?
Does "a similar named file" mean two files with the same filename?
I have two files /usr/lib/pm-utils/sleep.d/94cpufreq
and /etc/pm/sleep.d/20_cpu_freq
.
When resume and thaw, which one is run first and which second?
Thanks.
This question already has an answer here:
What does âLC_ALL=Câ do?
5 answers
power-management
asked Apr 2 at 22:37
Tim
22.6k63224401
22.6k63224401
marked as duplicate by muru, Jeff Schaller, Wouter Verhelst, Hauke Laging, Christopher Apr 4 at 13:34
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by muru, Jeff Schaller, Wouter Verhelst, Hauke Laging, Christopher Apr 4 at 13:34
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
The C lexical sort order is very simple: characters with a lower numeric value sort before characters with a higher one. As almost all UNIX-derived systems nowadays use extended ASCII-derived character sets, the ordering would therefore be 8-bit as follows:
- Control characters: NUL-US (
^@
-^_
: 0-26) - Printable characters:
(space)-
/
,0
-9
,:
-@
,A
-Z
,[
-`
,a
-z
,{
-~
- Extended characters: stuff afterwards (depends on the codepage)
Because of this, here are some filenames, in order:
!afile
0Afile
0_file
0afile
0~file
20-cpu_freq
20_cpu_freq
94Cpufreq
94cpufreq
By "similar named file", the two directory lists are combined, and if two file have the same name, the one in /etc/pm/sleep.d
wins: if you had /usr/lib/pm-utils/sleep.d/94cpufreq
and /etc/pm/sleep.d/94cpufreq
, the latter would be read.
The order which these will be run is dictated by the operation that pm-utils
is doing (from HOWTO.hooks):
SLEEP.D SPECIFIC NOTES
For any given sleep/wakeup cycle, the hooks in
sleep.d
are run twice:
- Once in C lexical sort order before the system goes to sleep, and
- Once in reverse C lexical sort order when the system wakes up.
TL;DR: 20_cpu_freq
will be run first and 94cpufreq
second when preparing to sleep, and the other way around when waking up.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
The C lexical sort order is very simple: characters with a lower numeric value sort before characters with a higher one. As almost all UNIX-derived systems nowadays use extended ASCII-derived character sets, the ordering would therefore be 8-bit as follows:
- Control characters: NUL-US (
^@
-^_
: 0-26) - Printable characters:
(space)-
/
,0
-9
,:
-@
,A
-Z
,[
-`
,a
-z
,{
-~
- Extended characters: stuff afterwards (depends on the codepage)
Because of this, here are some filenames, in order:
!afile
0Afile
0_file
0afile
0~file
20-cpu_freq
20_cpu_freq
94Cpufreq
94cpufreq
By "similar named file", the two directory lists are combined, and if two file have the same name, the one in /etc/pm/sleep.d
wins: if you had /usr/lib/pm-utils/sleep.d/94cpufreq
and /etc/pm/sleep.d/94cpufreq
, the latter would be read.
The order which these will be run is dictated by the operation that pm-utils
is doing (from HOWTO.hooks):
SLEEP.D SPECIFIC NOTES
For any given sleep/wakeup cycle, the hooks in
sleep.d
are run twice:
- Once in C lexical sort order before the system goes to sleep, and
- Once in reverse C lexical sort order when the system wakes up.
TL;DR: 20_cpu_freq
will be run first and 94cpufreq
second when preparing to sleep, and the other way around when waking up.
add a comment |Â
up vote
3
down vote
The C lexical sort order is very simple: characters with a lower numeric value sort before characters with a higher one. As almost all UNIX-derived systems nowadays use extended ASCII-derived character sets, the ordering would therefore be 8-bit as follows:
- Control characters: NUL-US (
^@
-^_
: 0-26) - Printable characters:
(space)-
/
,0
-9
,:
-@
,A
-Z
,[
-`
,a
-z
,{
-~
- Extended characters: stuff afterwards (depends on the codepage)
Because of this, here are some filenames, in order:
!afile
0Afile
0_file
0afile
0~file
20-cpu_freq
20_cpu_freq
94Cpufreq
94cpufreq
By "similar named file", the two directory lists are combined, and if two file have the same name, the one in /etc/pm/sleep.d
wins: if you had /usr/lib/pm-utils/sleep.d/94cpufreq
and /etc/pm/sleep.d/94cpufreq
, the latter would be read.
The order which these will be run is dictated by the operation that pm-utils
is doing (from HOWTO.hooks):
SLEEP.D SPECIFIC NOTES
For any given sleep/wakeup cycle, the hooks in
sleep.d
are run twice:
- Once in C lexical sort order before the system goes to sleep, and
- Once in reverse C lexical sort order when the system wakes up.
TL;DR: 20_cpu_freq
will be run first and 94cpufreq
second when preparing to sleep, and the other way around when waking up.
add a comment |Â
up vote
3
down vote
up vote
3
down vote
The C lexical sort order is very simple: characters with a lower numeric value sort before characters with a higher one. As almost all UNIX-derived systems nowadays use extended ASCII-derived character sets, the ordering would therefore be 8-bit as follows:
- Control characters: NUL-US (
^@
-^_
: 0-26) - Printable characters:
(space)-
/
,0
-9
,:
-@
,A
-Z
,[
-`
,a
-z
,{
-~
- Extended characters: stuff afterwards (depends on the codepage)
Because of this, here are some filenames, in order:
!afile
0Afile
0_file
0afile
0~file
20-cpu_freq
20_cpu_freq
94Cpufreq
94cpufreq
By "similar named file", the two directory lists are combined, and if two file have the same name, the one in /etc/pm/sleep.d
wins: if you had /usr/lib/pm-utils/sleep.d/94cpufreq
and /etc/pm/sleep.d/94cpufreq
, the latter would be read.
The order which these will be run is dictated by the operation that pm-utils
is doing (from HOWTO.hooks):
SLEEP.D SPECIFIC NOTES
For any given sleep/wakeup cycle, the hooks in
sleep.d
are run twice:
- Once in C lexical sort order before the system goes to sleep, and
- Once in reverse C lexical sort order when the system wakes up.
TL;DR: 20_cpu_freq
will be run first and 94cpufreq
second when preparing to sleep, and the other way around when waking up.
The C lexical sort order is very simple: characters with a lower numeric value sort before characters with a higher one. As almost all UNIX-derived systems nowadays use extended ASCII-derived character sets, the ordering would therefore be 8-bit as follows:
- Control characters: NUL-US (
^@
-^_
: 0-26) - Printable characters:
(space)-
/
,0
-9
,:
-@
,A
-Z
,[
-`
,a
-z
,{
-~
- Extended characters: stuff afterwards (depends on the codepage)
Because of this, here are some filenames, in order:
!afile
0Afile
0_file
0afile
0~file
20-cpu_freq
20_cpu_freq
94Cpufreq
94cpufreq
By "similar named file", the two directory lists are combined, and if two file have the same name, the one in /etc/pm/sleep.d
wins: if you had /usr/lib/pm-utils/sleep.d/94cpufreq
and /etc/pm/sleep.d/94cpufreq
, the latter would be read.
The order which these will be run is dictated by the operation that pm-utils
is doing (from HOWTO.hooks):
SLEEP.D SPECIFIC NOTES
For any given sleep/wakeup cycle, the hooks in
sleep.d
are run twice:
- Once in C lexical sort order before the system goes to sleep, and
- Once in reverse C lexical sort order when the system wakes up.
TL;DR: 20_cpu_freq
will be run first and 94cpufreq
second when preparing to sleep, and the other way around when waking up.
edited Apr 3 at 5:35
answered Apr 3 at 4:20
ErikF
2,7011413
2,7011413
add a comment |Â
add a comment |Â