Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
3f4d68cc
Commit
3f4d68cc
authored
24 years ago
by
Peter Eisentraut
Browse files
Options
Downloads
Patches
Plain Diff
Fix on Linux
parent
a25a785f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/bin/ipcclean/ipcclean.sh
+22
-22
22 additions, 22 deletions
src/bin/ipcclean/ipcclean.sh
with
22 additions
and
22 deletions
src/bin/ipcclean/ipcclean.sh
+
22
−
22
View file @
3f4d68cc
#!/bin/sh
#!/bin/sh
#
#
# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/ipcclean.sh,v 1.
9
2001/02/10
06:12:15 momjian
Exp $
# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/ipcclean.sh,v 1.
10
2001/02/10
10:27:28 petere
Exp $
#
#
CMDNAME
=
`
basename
$0
`
CMDNAME
=
`
basename
$0
`
...
@@ -38,8 +38,6 @@ EffectiveUser=`id -n -u 2>/dev/null || whoami 2>/dev/null`
...
@@ -38,8 +38,6 @@ EffectiveUser=`id -n -u 2>/dev/null || whoami 2>/dev/null`
# This is based on RedHat 5.2.
# This is based on RedHat 5.2.
#
#
if
[
`
uname
`
=
'Linux'
]
;
then
if
[
`
uname
`
=
'Linux'
]
;
then
ipcs_id
=
ipcs_lpid
=
did_anything
=
did_anything
=
if
ps x |
grep
-s
'[p]ostmaster'
>
/dev/null 2>&1
;
then
if
ps x |
grep
-s
'[p]ostmaster'
>
/dev/null 2>&1
;
then
...
@@ -48,34 +46,36 @@ if [ `uname` = 'Linux' ]; then
...
@@ -48,34 +46,36 @@ if [ `uname` = 'Linux' ]; then
fi
fi
# shared memory
# shared memory
for
val
in
`
ipcs
-m
-p
|
grep
'^[0-9]'
|
awk
'{printf "%s
%s\n", $1, $3, $4}'
`
for
val
in
`
ipcs
-m
-p
|
grep
'^[0-9]'
|
awk
'{printf "%s
:%s:
%s\n", $1, $3, $4}'
`
do
do
if
[
-z
"
$ipcs_id
"
]
;
then
save_IFS
=
$IFS
ipcs_id
=
$val
IFS
=
:
# Note: We can do -n here, because we know the platform.
set
X
$val
echo
-n
"Shared memory
$ipcs_id
... "
shift
continue
IFS
=
$save_IFS
fi
ipcs_shmid
=
$1
ipcs_cpid
=
$2
ipcs_lpid
=
$3
ipcs_lpid
=
$val
# Note: We can do -n here, because we know the platform.
echo
-n
"Shared memory
$ipcs_shmid
... "
# Don't do anything if process still running.
# Don't do anything if process still running.
# (This check is conceptually phony, but it's
# (This check is conceptually phony, but it's
# useful anyway in practice.)
# useful anyway in practice.)
ps hj
$ipcs_lpid
>
/dev/null 2>&1
ps hj
$ipcs_cpid
$ipcs_lpid
>
/dev/null 2>&1
if
[
$?
-eq
0
]
;
then
echo
"skipped; process still exists (pid
$ipcs_cpid
or
$ipcs_lpid
)."
continue
fi
# try remove
ipcrm shm
$ipcs_shmid
if
[
$?
-eq
0
]
;
then
if
[
$?
-eq
0
]
;
then
echo
"skipped. Process still exists (pid
$ipcs_lpid
)."
did_anything
=
t
else
else
# try remove
exit
ipcrm shm
$ipcs_id
if
[
$?
-eq
0
]
;
then
did_anything
=
t
else
exit
fi
fi
fi
ipcs_id
=
ipcs_lpid
=
done
done
# semaphores
# semaphores
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment