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

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

chanra1n4年前 (2022-10-10)Linux6634

首先进入服务文件夹

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工具” 的相关文章

NW788 MW788改NR285G教程及工具 附带CH341A 1.26版本 支持OTP写入 亲测改285成功

NW788 MW788改NR285G教程及工具 附带CH341A 1.26版本 支持OTP写入 亲测改285成功

285g读取1.bin支持(OTP分区)CH341A编程器1.26.rar原作者开发软件不容易,大家尽量购买正版设备,编程器软件烧写285固件的时候需要在选项里面选择主存储和OTP分区一块烧写淘宝买的1606E加密芯片(卖家坑爹,买了10个,发来有5个是MX258XX)看在包邮份上就不计较了存储芯片...

仅IPV6的VPS安装AWVS 13.x 14.x 并使用DNS NAT服务访问IPV4网页 教程展示Ubuntu18.x环境配置

仅IPV6的VPS安装AWVS 13.x 14.x 并使用DNS NAT服务访问IPV4网页 教程展示Ubuntu18.x环境配置

测试通过的环境:centos7 Ubuntu18.x1、使用root登录vps2、打开DNS NAT服务,通过修改DNS解析文件设置echo -e "nameserver 2001:67c:2b0::4\nameserver 2001:67c:2b0...

Ubuntu16.04 Armhf 内置APT源配置文件(备份)

Ubuntu16.04 Armhf 内置APT源配置文件(备份)

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of ...

使用Docker-Ubuntu14安装Synopsys2018工具 Leda PT VCS Verdi DVE FM SCL 爱快Docker EDA工具

使用Docker-Ubuntu14安装Synopsys2018工具 Leda PT VCS Verdi DVE FM SCL 爱快Docker EDA工具

synopsys2018链接:https://pan.baidu.com/s/1xnwKS4Lf-wdHxjv-cuyogA?pwd=z0hw 提取码:z0hw 仅用于学习,不得用于其他用途!1、首先在Docker拉取Ubuntu镜像,我使用的是爱快,其他X86操作系统类似。2、...

(原创)Ubuntu18+ 解决SpyGlass使用报错的问题 路径设置问题、证书、报错等问题

(原创)Ubuntu18+ 解决SpyGlass使用报错的问题 路径设置问题、证书、报错等问题

export SPYGLASS_HOME=/usr/synopsys/spyglass/SPYGLASS2017.12-SP2/SPYGLASS_HOME export PATH=$PATH:$SPYGLASS_HOME/bin alias run_spyglass...

(原创)解决Leda2008、2014等新版本Unit Name为空的问题

(原创)解决Leda2008、2014等新版本Unit Name为空的问题

在Leda2007中可以正常加载编译过程文件,并且能够正确显示Unit Name,但是在2008以及更新版本的Leda中,使用相同操作发现Unit Name为空。这时可以采用这样的方法去启动Leda,问题即可解决:run_leda_2014 -sverilog +gui ...