添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
直爽的饭盒  ·  在visual ...·  1 月前    · 
无邪的大熊猫  ·  linux opencv 静态编译 ...·  1 月前    · 
健身的雪糕  ·  NanoPi Duo2/zh - ...·  1 月前    · 
刚毅的抽屉  ·  xSky 实验室 ...·  5 天前    · 
刚毅的灭火器  ·  java:StringEscapeUtils ...·  4 月前    · 
胆小的冰淇淋  ·  Interactive ...·  5 月前    · 
憨厚的烈酒  ·  💫 趣 书 网 ...·  5 月前    · 

编译该程序,生成a.out可执行程序

greatwall@greatwall-KVM-Virtual-Machine:~/cproj$ gcc a.c
greatwall@greatwall-KVM-Virtual-Machine:~/cproj$ ll
总用量 24
drwxrwxr-x  2 greatwall greatwall 4096 6月   9 14:49 ./
drwx------ 26 greatwall greatwall 4096 6月   9 14:39 ../
-rw-rw-r--  1 greatwall greatwall   55 6月   9 14:38 a.c
-rwxrwxr-x  1 greatwall greatwall 9488 6月   9 14:49 a.out*

可以看到生成的a.out具备可执行权限

执行该程序

greatwall@greatwall-KVM-Virtual-Machine:~/cproj$ ./a.out
bash: ./a.out: 权限不够

方案一:设置麒麟系统安全状态为Softmode

greatwall@greatwall-KVM-Virtual-Machine:~/cproj$ sudo setstatus Softmode
[sudo] greatwall 的密码:
greatwall@greatwall-KVM-Virtual-Machine:~/cproj$ getstatus 
KySec status: Softmode
exec control: on
file protect: on
kmod protect: on
three admin : off
greatwall@greatwall-KVM-Virtual-Machine:~/cproj$ ./a.out

方案二:单独设置a.out文件kysec执行权限

greatwall@greatwall-KVM-Virtual-Machine:~/cproj$ sudo kysec_set -n exectl -v trusted ./a.out
[sudo] greatwall 的密码:
greatwall@greatwall-KVM-Virtual-Machine:~/cproj$ ./a.out

1. 方案一适合用在开发环境,可有效避免编译生成的各类文件不可执行故障

2. 方案二适合Normal模式下,安装软件后为软件制定可执行权限

kysec_set man手册

kysec_set(8)              System Manager's Manual              kysec_set(8)
       kysec_set - set kysec label for specfied path(s)
SYNOPSIS
       kysec_set [ -n part ] [ -r ] -v value path1 ..
DESCRIPTION
       kysec_set  set  the kysec label of specified files or directories to
       value.  Kysec label is composed of three parts: identify part,  pro‐
       tect part and exectl part.
       when  not used with -n option, kysec label should be in such format:
       "identify:protect:exectl". Set the new value to 'none' to clear  the
       corresponding part of kysec label.
       for identify part, these values are valid:
           secadm          commands for secadm
           audadm          commands for auditadm
       for exectl part, these values are valid:
           unknown              unknown files
           original             original system files
           verified             verified 3rd party files
           kysoft               software installer
           trusted              trusted files
       for protect part, only readonly is valid.
OPTIONS
       -n          set  specified part of kysec labels. part can be exectl,
              userid or protect.
       -r          process labels recursively, only usable for directories.
       -v          the new label value
EE ALSO
       getstatus(8), setstatus(8), kysec_get(8)
                                                               kysec_set(8)
Permission denied: user=root, access=WRITE, inode="/user":hdfs:superxxxxx 说明运行当前shell不能写入hdfs目录/user/xxxx。 解决方法是使用root用户 vim /etc/profile export HADO...
代码shutil.copyfile(os.path.join(sourcepath+'/'+eachclass+'/',im),valpath+'/'+eachclass+'/'+im)中 访问后一个路径上的文件valpath+'/'+eachclass+'/'+im,im是一个*.jpg图片,出现permission denied错误 原因分析:这个路径是jupter notebook默认...
security-switch --set strict //同时启用执行控制, SELinux 和三权分立 kysec_set -n exectl -v original /usr/bin/xxxx //可执行程序添加安全标记 setenforce 0 //执行这个,关闭selinux的,0是关闭,1是打开。
得到一个以.run结尾的安装文件,赋予它可执行权限。如果开启了SElinux模块,请先禁用! # chmod +x NVIDIA-Linux-x86_64-295.59.run 向一个目录(myResources)粘贴文件的时候,出现这样一个提示 Permission denied 是权限没设好,只是拷贝粘贴一个文件,怎么会这样? 解决的办法: $ sudo c
解决 ActiveX 0x7730DCBB (ntdll.dll) (iexplore.exe 中)处有未经处理的异常: 0xC0000374: 堆已损坏。 (参数: 0x77344268)。 24262 【AI】RTX2060 6G Ubuntu 22.04.1 LTS (Jammy Jellyfish) 部署Chinese-LLaMA-Alpaca-2 【2】启用GPU支持 原来很简单: 好的,我像这样编译的可以了,谢谢。 export CUDA_DOCKER_ARCH=compute_70 export LLAMA_CUDA=1 make clean make -j12 llama-server 【AI】RTX2060 6G Ubuntu 22.04.1 LTS (Jammy Jellyfish) 部署Chinese-LLaMA-Alpaca-2 【2】启用GPU支持 hkNaruto: 我直接问的通义千问。如果程序启动起来,显存没有一点使用率。那就说明根本没有启用显卡支持。你要核对一下你的编译过程。 【AI】RTX2060 6G Ubuntu 22.04.1 LTS (Jammy Jellyfish) 部署Chinese-LLaMA-Alpaca-2 【2】启用GPU支持 原来很简单: 请问NVIDIA显卡的 arch 参数值的官方文档介绍在哪里? 我使用 make llama-server 编译生成的 llama-server 运行服务,然后通过接口调用,CPU使用率蛮高,但是显存一点没使用,不知道为什么?