当前位置:首页 > Linux > 正文内容

(原创)Ubuntu18注册lmgrd服务,实现开机自启动 Synopsys工具

chanra1n2年前 (2022-10-10)Linux4262

首先进入服务文件夹

cd /lib/systemd/system

然后新建service文件

sudo touch edatools.service

然后编辑为以下内容,其中路径以实际为准:

[Unit]
Description=Synopsys tools active service
After=network.target

[Service]
Type=forking
ExecStart=/usr/synopsys/active_tools.sh
ExecReload=/usr/synopsys/active_tools.sh
ExecStop=/usr/synopsys/active_tools.sh
PrivateTmp=true

[Install]
WantedBy=multi-user.target
Alias=edatools.service

然后新建对应的sh文件(注意,这里实际只实现了启动的功能,如果需要停止的,参考sh文件自己改)

#!/bin/bash
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
echo "[$LOGTIME] startup run..." >>/root/startup_run.log
service ssh start >>/root/startup_run.log
echo "Detecting system status, please wait!"

rm -rf /tmp/lmstat.log
/usr/local/eda_tools/scl/2018.06/linux64/bin/lmstat >>/tmp/lmstat.log
if [ `grep -c "Cannot" /tmp/lmstat.log` -ne '0' ];then
    echo "Detected that the service is not running, trying to restart..."
    sudo kill -9 $(lsof -i:27000 -t)
    wait
    rm -rf /root/EDA_INITIAL.log
    cd /usr/local/eda_tools/scl/2018.06/linux64/bin && LD_PRELOAD=./snpslmd-hack.so ./lmgrd -c /usr/local/eda_tools/Synopsys.dat >> /root/EDA_INITIAL.log
    sleep 10s
    wait
    else
    echo "System service detected started!"
    exit 0
fi

rm -rf /tmp/lmstat.log
/usr/local/eda_tools/scl/2018.06/linux64/bin/lmstat >>/tmp/lmstat.log
if [ `grep -c "Cannot" /tmp/lmstat.log` -ne '0' ];then
    echo "Detected that the service is not running, trying to restart..."
    sudo kill -9 $(lsof -i:27000 -t)
    wait
    rm -rf /root/EDA_INITIAL.log
    cd /usr/local/eda_tools/scl/2018.06/linux64/bin && LD_PRELOAD=./snpslmd-hack.so ./lmgrd -c /usr/local/eda_tools/Synopsys.dat >> /root/EDA_INITIAL.log
    sleep 10s
    wait
    else
    echo "System service detected started!"
    exit 0
fi

rm -rf /tmp/lmstat.log
/usr/local/eda_tools/scl/2018.06/linux64/bin/lmstat >>/tmp/lmstat.log
if [ `grep -c "Cannot" /tmp/lmstat.log` -ne '0' ];then
    echo "It is detected that the service is not running, please contact the administrator..."
    exit 0
fi

然后运行

 sudo systemctl daemon-reload
 sudo systemctl enable edatools.service

就已经实现了开机启动程序。

如果需要立即开启服务,可以运行

service edatools start

也可以查看服务状态

service edatools status


扫描二维码推送至手机访问。

版权声明:本文由我的FPGA发布,如需转载请注明出处。

本文链接:https://world.myfpga.cn/index.php/post/284.html

分享给朋友:

“(原创)Ubuntu18注册lmgrd服务,实现开机自启动 Synopsys工具” 的相关文章

Centos7 基于Docker安装OnlineJudge

Centos7 基于Docker安装OnlineJudge

点击访问青岛大学OnlineJudge GitHub地址首先你需要安装Docker,如果您并没有安装,您可以移步我们上一篇文章,那里介绍了如何安装Docker,https://world.myfpga.cn/?id=69如果您已经安装了Docker,现在请您运行以下内容一键安装OnlineJudge...

一键升级Centos6 Python至2.7.9 并安装宝塔

一键升级Centos6 Python至2.7.9 并安装宝塔

#直接复制运行命令即可 curl -o install.sh http://download.myfpga.cn/linux/centos/pythonandbt.sh && sh install.sh...

强大的视频格式转换工具 FFmpeg的安装

强大的视频格式转换工具 FFmpeg的安装

kali环境下的安装sudo apt-get install ffmpeg -y && ffmpeg -versionUbuntu环境下的安装sudo apt install ffmp...

小米路由器MINI刷爱快固件

小米路由器MINI刷爱快固件

uboot-xiaomi-mini-115200.binIK-MT7620AV4-H1S.bin...

MW788刷NR285G固件

MW788刷NR285G固件

netcore(NR285G).zip...

(挂机赚钱)任意Arm/X86架构Win/Linux安装猕猴桃CDN教程 树莓派 OrangePi 友善之臂 ArmCortex9

(挂机赚钱)任意Arm/X86架构Win/Linux安装猕猴桃CDN教程 树莓派 OrangePi 友善之臂 ArmCortex9

前言这应该是全网第一个任意Arm架构的猕猴桃安装教程,我已经安装实现了。想跑猕猴桃,点击右侧链接官网注册→, https://www.bdkjcdn.com/register X86平台X86  i386 Linux/Windows 等的部署请点击->宽带变现 每...