{"id":55932,"date":"2023-10-20T09:10:26","date_gmt":"2023-10-20T01:10:26","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=55932"},"modified":"2023-10-20T09:10:26","modified_gmt":"2023-10-20T01:10:26","slug":"ldlhzdcqyy","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/55932.html","title":{"rendered":"Linux\u767b\u5f55\u540e\u81ea\u52a8\u91cd\u542f\u5e94\u7528"},"content":{"rendered":"
Linux\u767b\u5f55\u540e\u81ea\u52a8\u91cd\u542f\u5e94\u7528\u662f\u4e00\u79cd\u5728Linux\u7cfb\u7edf\u4e2d\u5229\u7528\u811a\u672c\u5b9e\u73b0\u81ea\u52a8\u91cd\u542f\u5e94\u7528\u7684\u65b9\u6cd5\u3002\u5b83\u662f\u4e00\u79cd\u7b80\u5355\u3001\u5feb\u6377\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u66f4\u6709\u6548\u5730\u7ba1\u7406\u7cfb\u7edf\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecdLinux\u767b\u5f55\u540e\u81ea\u52a8\u91cd\u542f\u5e94\u7528\u7684\u5b9e\u73b0\u8fc7\u7a0b\uff0c\u5e76\u4ecb\u7ecd\u4e00\u4e9b\u5e38\u89c1\u7684\u5e94\u7528\u573a\u666f\u3002<\/p>\n
\u8981\u5b9e\u73b0Linux\u767b\u5f55\u540e\u81ea\u52a8\u91cd\u542f\u5e94\u7528\uff0c\u9996\u5148\u9700\u8981\u8bbe\u7f6e\u4e00\u4e2a\u811a\u672c\uff0c\u8be5\u811a\u672c\u5c06\u5728Linux\u767b\u5f55\u540e\u81ea\u52a8\u6267\u884c\uff0c\u5e76\u8d1f\u8d23\u91cd\u542f\u5e94\u7528\u3002\u811a\u672c\u7684\u5b9e\u73b0\u65b9\u5f0f\u6709\u591a\u79cd\uff0c\u6700\u5e38\u89c1\u7684\u662f\u4f7f\u7528bash\u811a\u672c\u3002<\/p>\n
\u9996\u5148\uff0c\u9700\u8981\u5728Linux\u7cfb\u7edf\u4e2d\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a\u201clogin-restart.sh\u201d\u7684\u6587\u4ef6\uff0c\u5e76\u5c06\u4ee5\u4e0b\u5185\u5bb9\u590d\u5236\u5230\u6587\u4ef6\u4e2d\uff1a<\/p>\n
#!\/bin\/bash<\/p>\n
# restart application<\/p>\n
\/usr\/bin\/restart-app<\/p>\n
\u8fd9\u6bb5\u811a\u672c\u5c06\u5728\u767b\u5f55\u540e\u6267\u884c\uff0c\u5e76\u8c03\u7528\/usr\/bin\/restart-app\u547d\u4ee4\u6765\u91cd\u542f\u5e94\u7528\u3002<\/p>\n
\u63a5\u4e0b\u6765\uff0c\u9700\u8981\u8bbe\u7f6e\u767b\u5f55\u540e\u81ea\u52a8\u6267\u884c\u811a\u672c\u3002\u53ef\u4ee5\u4f7f\u7528Linux\u7cfb\u7edf\u4e2d\u7684\u201c.profile\u201d\u6587\u4ef6\u6765\u5b9e\u73b0\uff0c\u8be5\u6587\u4ef6\u5c06\u5728\u6bcf\u6b21\u767b\u5f55\u65f6\u81ea\u52a8\u6267\u884c\u3002<\/p>\n
\u53ef\u4ee5\u5728\u201c.profile\u201d\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n
# Run the restart script on login<\/p>\n
\/bin\/bash \/path\/to\/login-restart.sh<\/p>\n
\u8fd9\u6837\uff0c\u6bcf\u6b21\u767b\u5f55\u540e\uff0c\u7cfb\u7edf\u90fd\u4f1a\u81ea\u52a8\u6267\u884c\u811a\u672c\uff0c\u4ece\u800c\u81ea\u52a8\u91cd\u542f\u5e94\u7528\u3002<\/p>\n
\u672c\u6587\u4ecb\u7ecd\u4e86\u5982\u4f55\u5b9e\u73b0Linux\u767b\u5f55\u540e\u81ea\u52a8\u91cd\u542f\u5e94\u7528\u7684\u65b9\u6cd5\u3002\u9996\u5148\uff0c\u9700\u8981\u8bbe\u7f6e\u4e00\u4e2a\u811a\u672c\uff0c\u8be5\u811a\u672c\u5c06\u5728Linux\u767b\u5f55\u540e\u81ea\u52a8\u6267\u884c\uff0c\u5e76\u8d1f\u8d23\u91cd\u542f\u5e94\u7528\u3002\u5176\u6b21\uff0c\u9700\u8981\u8bbe\u7f6e\u767b\u5f55\u540e\u81ea\u52a8\u6267\u884c\u811a\u672c\uff0c\u53ef\u4ee5\u4f7f\u7528Linux\u7cfb\u7edf\u4e2d\u7684\u201c.profile\u201d\u6587\u4ef6\u6765\u5b9e\u73b0\u3002\u8fd9\u6837\uff0c\u6bcf\u6b21\u767b\u5f55\u540e\uff0c\u7cfb\u7edf\u90fd\u4f1a\u81ea\u52a8\u6267\u884c\u811a\u672c\uff0c\u4ece\u800c\u81ea\u52a8\u91cd\u542f\u5e94\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
Linux\u767b\u5f55\u540e\u81ea\u52a8\u91cd\u542f\u5e94\u7528\u662f\u4e00\u79cd\u5728Linux\u7cfb\u7edf\u4e2d\u5229\u7528\u811a\u672c\u5b9e\u73b0\u81ea\u52a8\u91cd\u542f\u5e94\u7528\u7684\u65b9\u6cd5\u3002\u5b83\u662f\u4e00\u79cd\u7b80\u5355\u3001\u5feb\u6377\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u66f4\u6709\u6548\u5730\u7ba1\u7406\u7cfb\u7edf\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecdLinu<\/p>\n","protected":false},"author":1,"featured_media":4132,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[36],"tags":[305],"class_list":["post-55932","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-dzjs"],"_links":{"self":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/55932","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/comments?post=55932"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/55932\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/4132"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=55932"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=55932"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=55932"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}