BREAKING CHANGE(daemon): Refactor daemon and service management: remove IPC auto-spawn, add TspmServiceManager, tighten IPC/client/CLI behavior and tests
This commit is contained in:
@@ -5,21 +5,24 @@ import type { CliArguments } from '../../types.js';
|
||||
|
||||
export function registerDisableCommand(smartcli: plugins.smartcli.Smartcli) {
|
||||
const cliLogger = new Logger('CLI');
|
||||
|
||||
|
||||
smartcli.addCommand('disable').subscribe({
|
||||
next: async (argvArg: CliArguments) => {
|
||||
try {
|
||||
const serviceManager = new TspmServiceManager();
|
||||
console.log('Disabling TSPM daemon service...');
|
||||
|
||||
|
||||
await serviceManager.disableService();
|
||||
|
||||
|
||||
console.log('✓ TSPM daemon service disabled');
|
||||
console.log(' The daemon will no longer start on system boot');
|
||||
console.log(' Use "tspm enable" to re-enable the service');
|
||||
} catch (error) {
|
||||
console.error('Error disabling service:', error.message);
|
||||
if (error.message.includes('permission') || error.message.includes('denied')) {
|
||||
if (
|
||||
error.message.includes('permission') ||
|
||||
error.message.includes('denied')
|
||||
) {
|
||||
console.log('\nNote: You may need to run this command with sudo');
|
||||
}
|
||||
process.exit(1);
|
||||
@@ -30,4 +33,4 @@ export function registerDisableCommand(smartcli: plugins.smartcli.Smartcli) {
|
||||
},
|
||||
complete: () => {},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user