shutdown

Linux/CentOS基础命令1

落爺英雄遲暮 提交于 2019-12-06 08:43:59
一、系统相关运行命令 1、系统关机命令:shutdown # shutdown 关机 Shutdown scheduled for Fri 2019-03-29 11:36:45 CST, use 'shutdown -c' to cancel. 定义一个关机方案=定义什么时间进行关机,使用shutdown -c 取消关机计划 【为什么出现提示? 补充说明:linux是多用户的系统(windows是多用户的系统(收费性质))当出现关机情况是,系统会提示当前下的所有用户(前提为有权限关机)】 Broadcast message from root@CentOS.com (Fri 2019-03-29 11:35:45 CST): 将关机的广播信息通知所有关机主机的用户 The system is going down for power-off at Fri 2019-03-29 11:36:45 CST! 系统将在真正时间点关机 # shutdown -c 取消关机 # shutdown -h 5 指定关机时间 表示几分钟后关机 # halt 立即关机 # poweroff 立即关机 2、系统重启 # reboot 直接重启 # shutdown -r 重启 # shutdown -r 5 指定重启时间 表示几分钟后重启 二、目录路径相关命令 #ls =list 查看目录

node.js执行shell命令进行服务器重启

折月煮酒 提交于 2019-12-06 08:31:44
nodejs功能强大且多样,不只是可以实现 服务器端 与 客户端 的实时通讯,另一个功能是用来执行shell命令 1、首先,引入子进程模块 var process = require('child_process'); 2、然后,调用该模块暴露出来的方法exec process.exec('shutdown -h now',function (error, stdout, stderr) { if (error !== null) { console.log('exec error: ' + error); } }); 回调函数非必须! 3、具体案例 var express = require('express'); var app = express(); var process = require('child_process'); app.get('/restart/ccss', function (req, res) { res.send('OK'); process.exec('shutdown -r now',function (error, stdout, stderr) { if (error !== null) { console.log('exec error: ' + error); } }); }) var server = app.listen(8081,

转   redis服务启动和停止(NOAUTH Authentication required)

时光怂恿深爱的人放手 提交于 2019-12-06 07:28:22
redis服务启动和停止(NOAUTH Authentication required) 2017年05月02日 10:50:51 阅读数:8581 Redis安装配置完成后,启动过程非常简单,执行命令/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf即可(在Linux里一般执行 ./redis-server ../redis.conf)。停止Redis的最简单的方法是在启动实例的session中,直接使用Control-C命令。当然还可以通过客户端来停止服务,如可以用shutdown来停止Redis实例,具体命令为src/redis-cli shutdown。 Redis的三种启动方式 I. 直接启动 启动 #加上`&`号使redis以后台程序方式运行 ./redis-server & 1 2 检测 #检测后台进程是否存在 ps -ef |grep redis #检测6379端口是否在监听 netstat -lntp | grep 6379 #使用`redis-cli`客户端检测连接是否正常 ./redis-cli -h 127.0.0.1 -p 6379 -a 123456 127.0.0.1:6379> keys * (empty list or set) 127.0.0.1:6379> set

Prevent windows shutdown from python

泄露秘密 提交于 2019-12-06 07:16:47
问题 I want to prevent windows (xp and 7) from shutting down. For that it seems I have to intercept the WM_QUERYENDSESSION message and return False. Ok I have to correct my statement, this program works fine under Windows 7 but on Windows 7 embedded Standard Service Pack 1 it does not prevent the shutdown!? import ctypes from ctypes import c_long, c_int, c_wchar_p import time import win32api import win32con import win32gui import win32process oldWndProc = None def wndproc(hWnd, msg, wParam, lParam

Finding Which Program Runs Another

自作多情 提交于 2019-12-06 05:22:52
I have an NAS running on a limited version of what appears to be Redhat Linux. I followed directions to hack it so I could have shell access, which has been a big help. I've also made a couple modifications, ones that others have done and, other than one issue, they all seem to work fine. Somehow, every 22 days, the system shuts down. I used a script running ps to find that shutdown is actually called, but I don't know what program calls shutdown. If I rename /sbin/shutdown, then I could write a script to replace it. But the most important piece of information I'd like is what program is

shutdown hook in tomcat (necessary) not running

99封情书 提交于 2019-12-06 05:02:58
问题 I have a long running cpu and database intensive thread (that runs at low priority) that can be fired off by my tomcat application by an administrator request. I use a shutdown hook for this thread, so that if the application is stopped forcefully, it can clean up the database state before exiting. Works in standalone mode perfectly, with control-C and canceling in eclipse console. But when running under tomcat, and when I do a: $CATALINA_HOME/bin/shutdown.sh I verified with debug logging

Terminate Amazon EC2 instance using shutdown

左心房为你撑大大i 提交于 2019-12-06 03:36:20
问题 I can terminate Amazon EC2 instances using the API command ec2-terminate-instances but I'm trying to find out how to do this while logged onto the EC2 instances themselves. I've tried shutdown -h now but this only "stops" the instance, without fully terminating it. Is there any way to do this? 回答1: There is an option that you can set at instance creation that will allow the instance to terminate on shutdown. If you're using the ec2 command line tools, add the option: --instance-initiated

oracle initialization or shutdown in progress解决方法

假如想象 提交于 2019-12-06 02:48:21
今儿一直在测试服务器的迁移问题,不断地创建表空间、创建数据库、创建用户。后来感觉创建这么多东西太占用磁盘空间,心想删除一下吧,于是,我们执行了dbca命令,将没用的数据库统统删除,将dbf和dmp文件也统统删除了,再后来发现服务无法启动了,连接时会提示oracle initialization or shutdown in progress,后来经过查询发现,原来这些dbf和dmp不是说删除就能删除的(当时我们明明发现有的不允许删除,我还是故意停停掉oracle服务,然后将其删除滴),最终导致数据库实例无法启动。 我的解决过程如下: Microsoft Windows [版本 5.2.3790] (C) 版权所有 1985-2003 Microsoft Corp. C:\Documents and Settings\Administrator>sqlplus /nolog SQL*Plus: Release 10.2.0.1.0 - Production on 星期五 3月 4 18:40:13 2011 Copyright (c) 1982, 2005, Oracle. All rights reserved. SQL> connect system/hope; ERROR: ORA-01033: ORACLE initialization or shutdown in

Is there something like a ServletContextListener in JSF?

倖福魔咒の 提交于 2019-12-06 02:23:48
I would like to listen if a JSF application is started or stopped like as possible with a ServletContextListener in a plain Servlet web application. How can I achieve this? You can use an @ApplicationScoped @ManagedBean which is eagerly initialized and annotate the desired startup/shutdown hook methods with @PostConstruct and @PreDestroy respectively. So: @ManagedBean(eager=true) @ApplicationScoped public class App { @PostConstruct public void init() { // ... } @PreDestroy public void destroy() { // ... } } Please note that this does not mean that you can't use a ServletContextListener in a

Ascertaining a shutdown is closing my application

喜你入骨 提交于 2019-12-06 02:22:12
问题 Is it possible in .NET to ascertain whether my application is closing due to Windows being given a shutdown command (as opposed to any old application closing) in order to either write out some temporary cache files or even block the shutdown long enough to prompt for user input? Whilst my current scope involves a Winform app and a windows service, I am interested in understanding this in a generic way if possible 回答1: SystemEvents.SessionEnding looks like a good starting point for you. That