fdfs_trackerd and fdfs_storaged print the server version in usage

pull/484/head
YuQing 2019-12-13 10:59:07 +08:00
parent 24bb1e97b5
commit a49735ae5a
4 changed files with 30 additions and 5 deletions

View File

@ -1,4 +1,9 @@
Version 6.05 2019-12-13
* fdfs_trackerd and fdfs_storaged print the server version in usage.
you can execute fdfs_trackerd or fdfs_storaged without parameters
to show the server version
Version 6.04 2019-12-05 Version 6.04 2019-12-05
* storage_report_ip_changed ignore result EEXIST * storage_report_ip_changed ignore result EEXIST
* use get_gzip_command_filename from libfastcommon v1.42 * use get_gzip_command_filename from libfastcommon v1.42

View File

@ -1808,7 +1808,7 @@ int storage_do_append_file(ConnectionInfo *pTrackerServer, \
} }
/** /**
STORAGE_PROTO_CMD_APPEND_FILE: STORAGE_PROTO_CMD_MODIFY_FILE:
8 bytes: appender filename length 8 bytes: appender filename length
8 bytes: file offset 8 bytes: file offset
8 bytes: file size 8 bytes: file size

View File

@ -77,7 +77,9 @@ static void sigDumpHandler(int sig);
static void usage(const char *program) static void usage(const char *program)
{ {
fprintf(stderr, "Usage: %s <config_file> [start | stop | restart]\n", fprintf(stderr, "FastDFS server v%d.%02d\n"
"Usage: %s <config_file> [start | stop | restart]\n",
g_fdfs_version.major, g_fdfs_version.minor,
program); program);
} }
@ -104,6 +106,14 @@ int main(int argc, char *argv[])
trunk_shared_init(); trunk_shared_init();
conf_filename = argv[1]; conf_filename = argv[1];
if (!fileExists(conf_filename))
{
if (starts_with(conf_filename, "-"))
{
usage(argv[0]);
return 0;
}
}
if ((result=get_base_path_from_conf_file(conf_filename, if ((result=get_base_path_from_conf_file(conf_filename,
g_fdfs_base_path, sizeof(g_fdfs_base_path))) != 0) g_fdfs_base_path, sizeof(g_fdfs_base_path))) != 0)
{ {

View File

@ -70,7 +70,9 @@ static void sigDumpHandler(int sig);
static void usage(const char *program) static void usage(const char *program)
{ {
fprintf(stderr, "Usage: %s <config_file> [start | stop | restart]\n", fprintf(stderr, "FastDFS server v%d.%02d\n"
"Usage: %s <config_file> [start | stop | restart]\n",
g_fdfs_version.major, g_fdfs_version.minor,
program); program);
} }
@ -100,6 +102,14 @@ int main(int argc, char *argv[])
log_init2(); log_init2();
conf_filename = argv[1]; conf_filename = argv[1];
if (!fileExists(conf_filename))
{
if (starts_with(conf_filename, "-"))
{
usage(argv[0]);
return 0;
}
}
if ((result=get_base_path_from_conf_file(conf_filename, if ((result=get_base_path_from_conf_file(conf_filename,
g_fdfs_base_path, sizeof(g_fdfs_base_path))) != 0) g_fdfs_base_path, sizeof(g_fdfs_base_path))) != 0)
{ {