File tree Expand file tree Collapse file tree 3 files changed +9
-11
lines changed
logViewerService/assets/data Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -12,4 +12,3 @@ InaccessiblePaths=-/etc/pam.d
1212InaccessiblePaths =-/usr/share/uadp
1313InaccessiblePaths =-/etc/sudoers
1414InaccessiblePaths =-/etc/sudoers.d
15- MemoryMax =8G
Original file line number Diff line number Diff line change @@ -471,9 +471,10 @@ void LogAllExportThread::run()
471471 if (!m_cancel.load ()) {
472472 // Create temporary directory for ops logs
473473 QString userHomePath = QStandardPaths::writableLocation (QStandardPaths::HomeLocation);
474- QString opsLogPath = QDir::tempPath () + " /deepin-log-viewer-ops-logs- " + QString::number ( QDateTime::currentMSecsSinceEpoch () );
474+ QTemporaryDir tempDir ( QDir::tempPath () + " /XXXXXX " );
475475
476- if (QDir ().mkpath (opsLogPath)) {
476+ if (tempDir.isValid ()) {
477+ QString opsLogPath = tempDir.path ();
477478 DLDBusHandler::instance (this )->exportOpsLog (opsLogPath, userHomePath);
478479 completedTasks += 5 ;
479480 emit updatecurrentProcess (completedTasks);
@@ -538,15 +539,14 @@ void LogAllExportThread::run()
538539 }
539540 completedTasks += 2 ;
540541 emit updatecurrentProcess (completedTasks);
541- // Clean up temporary directory
542- if (!Utils::deleteDir (opsLogPath)) {
543- qCWarning (logApp) << " Failed to remove temporary ops log directory:" << opsLogPath;
544- }
545- completedTasks += 1 ;
546- emit updatecurrentProcess (completedTasks);
547542 } else {
548- qCCritical (logApp) << " Failed to create temporary ops log directory:" << opsLogPath;
543+ qCCritical (logApp) << " Failed to create temporary ops log directory" ;
544+ completedTasks += 9 ;
545+ emit updatecurrentProcess (completedTasks);
549546 }
547+
548+ completedTasks += 1 ;
549+ emit updatecurrentProcess (completedTasks);
550550 }
551551
552552 zipClose (m_zipFile, " Exported by Deepin Log Viewer" );
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ BusName=com.deepin.logviewer
99ExecStart =/usr/lib/deepin-daemon/log-view-service
1010# cap能力不能填为空,否则日志收集工具启动卡,并且不能查看/var/log下日志,建议cap能力不能为dbus必查项
1111#CapabilityBoundingSet=~CAP_NET_RAW
12- MemoryMax =8G
1312# 非root有阻塞,deepin-daemon启动后不能通过/proc/pid/exe获取启动进程全路径,下一阶段再按deepin-dameon启动
1413#User=deepin-daemon
1514ProtectSystem =strict
You can’t perform that action at this time.
0 commit comments