Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
fb0d37bc
Commit
fb0d37bc
authored
Feb 07, 2006
by
pekka@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - add option ndbd --foreground for manual debugging
parent
9b25294b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
11 deletions
+34
-11
ndb/src/kernel/main.cpp
ndb/src/kernel/main.cpp
+11
-7
ndb/src/kernel/vm/Configuration.cpp
ndb/src/kernel/vm/Configuration.cpp
+14
-3
ndb/src/kernel/vm/Configuration.hpp
ndb/src/kernel/vm/Configuration.hpp
+9
-1
No files found.
ndb/src/kernel/main.cpp
View file @
fb0d37bc
...
...
@@ -272,8 +272,8 @@ int main(int argc, char** argv)
#ifndef NDB_WIN32
signal
(
SIGUSR1
,
handler_sigusr1
);
pid_t
child
;
while
(
1
)
pid_t
child
=
-
1
;
while
(
!
theConfig
->
getForegroundMode
())
// the cond is const
{
// setup reporting between child and parent
int
filedes
[
2
];
...
...
@@ -395,8 +395,10 @@ int main(int argc, char** argv)
if
(
child
>=
0
)
g_eventLogger
.
info
(
"Angel pid: %d ndb pid: %d"
,
getppid
(),
getpid
());
else
else
if
(
child
>
0
)
g_eventLogger
.
info
(
"Ndb pid: %d"
,
getpid
());
else
g_eventLogger
.
info
(
"Ndb started in foreground"
);
#else
g_eventLogger
.
info
(
"Ndb started"
);
#endif
...
...
@@ -571,10 +573,7 @@ catchsigs(bool ignore){
#ifdef SIGPOLL
SIGPOLL
,
#endif
SIGSEGV
,
#ifdef SIGTRAP
SIGTRAP
#endif
SIGSEGV
};
static
const
int
signals_ignore
[]
=
{
...
...
@@ -588,6 +587,11 @@ catchsigs(bool ignore){
handler_register
(
signals_error
[
i
],
handler_error
,
ignore
);
for
(
i
=
0
;
i
<
sizeof
(
signals_ignore
)
/
sizeof
(
signals_ignore
[
0
]);
i
++
)
handler_register
(
signals_ignore
[
i
],
SIG_IGN
,
ignore
);
#ifdef SIGTRAP
Configuration
*
theConfig
=
globalEmulatorData
.
theConfiguration
;
if
(
!
theConfig
->
getForegroundMode
())
handler_register
(
SIGTRAP
,
handler_error
,
ignore
);
#endif
#endif
}
...
...
ndb/src/kernel/vm/Configuration.cpp
View file @
fb0d37bc
...
...
@@ -48,11 +48,13 @@ extern EventLogger g_eventLogger;
enum
ndbd_options
{
OPT_INITIAL
=
NDB_STD_OPTIONS_LAST
,
OPT_NODAEMON
OPT_NODAEMON
,
OPT_FOREGROUND
};
NDB_STD_OPTS_VARS
;
static
int
_daemon
,
_no_daemon
,
_initial
,
_no_start
;
// XXX should be my_bool ???
static
int
_daemon
,
_no_daemon
,
_foreground
,
_initial
,
_no_start
;
/**
* Arguments to NDB process
*/
...
...
@@ -75,6 +77,11 @@ static struct my_option my_long_options[] =
"Do not start ndbd as daemon, provided for testing purposes"
,
(
gptr
*
)
&
_no_daemon
,
(
gptr
*
)
&
_no_daemon
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"foreground"
,
OPT_FOREGROUND
,
"Run real ndbd in foreground, provided for debugging purposes"
" (implies --nodaemon)"
,
(
gptr
*
)
&
_foreground
,
(
gptr
*
)
&
_foreground
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
0
,
0
,
0
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
}
};
static
void
short_usage_sub
(
void
)
...
...
@@ -103,13 +110,14 @@ Configuration::init(int argc, char** argv)
ndb_std_get_one_option
)))
exit
(
ho_error
);
if
(
_no_daemon
)
{
if
(
_no_daemon
||
_foreground
)
{
_daemon
=
0
;
}
DBUG_PRINT
(
"info"
,
(
"no_start=%d"
,
_no_start
));
DBUG_PRINT
(
"info"
,
(
"initial=%d"
,
_initial
));
DBUG_PRINT
(
"info"
,
(
"daemon=%d"
,
_daemon
));
DBUG_PRINT
(
"info"
,
(
"foreground=%d"
,
_foreground
));
DBUG_PRINT
(
"info"
,
(
"connect_str=%s"
,
opt_connect_str
));
ndbSetOwnVersion
();
...
...
@@ -131,6 +139,8 @@ Configuration::init(int argc, char** argv)
// Check daemon flag
if
(
_daemon
)
_daemonMode
=
true
;
if
(
_foreground
)
_foregroundMode
=
true
;
// Save programname
if
(
argc
>
0
&&
argv
[
0
]
!=
0
)
...
...
@@ -151,6 +161,7 @@ Configuration::Configuration()
_backupPath
=
0
;
_initialStart
=
false
;
_daemonMode
=
false
;
_foregroundMode
=
false
;
m_config_retriever
=
0
;
m_clusterConfig
=
0
;
m_clusterConfigIter
=
0
;
...
...
ndb/src/kernel/vm/Configuration.hpp
View file @
fb0d37bc
...
...
@@ -64,6 +64,7 @@ public:
bool
getInitialStart
()
const
;
void
setInitialStart
(
bool
val
);
bool
getDaemonMode
()
const
;
bool
getForegroundMode
()
const
;
const
ndb_mgm_configuration_iterator
*
getOwnConfigIterator
()
const
;
...
...
@@ -105,7 +106,8 @@ private:
char
*
_connectString
;
Uint32
m_mgmd_port
;
BaseString
m_mgmd_host
;
bool
_daemonMode
;
bool
_daemonMode
;
// if not, angel in foreground
bool
_foregroundMode
;
// no angel, raw ndbd in foreground
void
calcSizeAlt
(
class
ConfigValues
*
);
};
...
...
@@ -140,4 +142,10 @@ Configuration::getDaemonMode() const {
return
_daemonMode
;
}
inline
bool
Configuration
::
getForegroundMode
()
const
{
return
_foregroundMode
;
}
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment